summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/defaulted14.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/defaulted14.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted14.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted14.C b/gcc/testsuite/g++.dg/cpp0x/defaulted14.C
new file mode 100644
index 000000000..e476d576c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted14.C
@@ -0,0 +1,20 @@
+// PR c++/39866
+// { dg-options "-std=c++0x" }
+
+struct A {
+ A& operator=(const A&) = delete; // { dg-bogus "" }
+
+ void operator=(int) {} // { dg-message "" }
+ void operator=(char) {} // { dg-message "" }
+};
+
+struct B {};
+
+int main()
+{
+ A a;
+ a = B(); // { dg-error "no match" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 16 }
+ a = 1.0; // { dg-error "ambiguous" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 18 }
+}