summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/opeq3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/opeq3.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/opeq3.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/opeq3.C b/gcc/testsuite/g++.old-deja/g++.jason/opeq3.C
new file mode 100644
index 000000000..b4e6e2550
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/opeq3.C
@@ -0,0 +1,15 @@
+// { dg-do assemble }
+// Bug: g++ generates code for assignment in invalid situations.
+
+class X { // { dg-error "reference|operator=" }
+ int& a;
+public:
+ X(int& i): a(i) { }
+};
+
+void foo ()
+{
+ int one=1, two=2;
+ X a(one), b(two);
+ a = b; // { dg-message "synthesized|deleted" }
+}