summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/diag2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/diag2.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/diag2.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/diag2.C b/gcc/testsuite/g++.dg/cpp0x/diag2.C
new file mode 100644
index 00000000000..0d01b1de795
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/diag2.C
@@ -0,0 +1,19 @@
+// { dg-do compile { target c++11 } }
+
+struct A {};
+
+// We shouldn't arbitarily choose which of these is better.
+void f (A&);
+void f (const A&&);
+
+// But do prefer the lvalue overload here.
+void g (A&);
+void g (A&&);
+int main()
+{
+ const A a;
+ f(a); // { dg-error "no match" }
+ // { dg-error "qualifiers" "" { target *-*-* } 15 }
+ // { dg-error "lvalue" "" { target *-*-* } 15 }
+ g(a); // { dg-error "qualifiers" }
+}