summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/crash100.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/crash100.C')
-rw-r--r--gcc/testsuite/g++.dg/template/crash100.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/crash100.C b/gcc/testsuite/g++.dg/template/crash100.C
new file mode 100644
index 000000000..c67ae2eca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash100.C
@@ -0,0 +1,24 @@
+// PR c++/44628
+
+template <typename T>
+class Temp
+{
+ int Val;
+ public:
+ operator T&(void) { return Val; }
+
+ virtual T& operator=(T a ) // { dg-error "overriding" }
+ {
+ Val = a;
+ return Val;
+ }
+};
+
+class Int : public Temp<int>
+{
+ public:
+ Int& operator=(int a) // { dg-error "conflicting return type" }
+ {
+ return (*this);
+ }
+};