aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C
new file mode 100644
index 0000000..663f400
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C
@@ -0,0 +1,25 @@
+// PR c++/46831
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+struct B { };
+struct D : B { };
+struct A {
+ template<typename T = void> operator D&(); // { dg-message "template conversion" }
+ operator long();
+};
+
+void f(long);
+void f(B&);
+
+struct A2 {
+ template<typename T = void> operator B&();
+};
+
+void f2(const B&);
+
+int main() {
+ f(A());
+ f2(A2());
+ f2(A()); // { dg-error "" }
+}