summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/crash127.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/crash127.C')
-rw-r--r--gcc/testsuite/g++.dg/template/crash127.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/crash127.C b/gcc/testsuite/g++.dg/template/crash127.C
new file mode 100644
index 00000000000..b7c03251f8c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash127.C
@@ -0,0 +1,22 @@
+// PR c++/71440
+
+struct A
+{
+ void f () {}
+};
+
+typedef void (A::*Ptr) ();
+
+template < Ptr > struct B {};
+
+template < class T >
+struct C : public A
+{
+ void bar ()
+ {
+ B < &A::A > b; // { dg-error "taking address of constructor 'A::A" "" { target c++98_only } }
+ // { dg-error "taking address of constructor 'constexpr A::A" "" { target c++11 } .-1 }
+ }
+};
+
+template class C < int >;