summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/ptrmem11.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/ptrmem11.C')
-rw-r--r--gcc/testsuite/g++.dg/other/ptrmem11.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/ptrmem11.C b/gcc/testsuite/g++.dg/other/ptrmem11.C
new file mode 100644
index 00000000000..a850c55c40a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/ptrmem11.C
@@ -0,0 +1,21 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/37093
+
+struct A {};
+
+template <int A::* p>
+int
+foo(A* q)
+{
+ return q->*p;
+}
+
+template <typename T>
+int
+bar(int T::* p)
+{
+ return foo<p>(0);// { dg-error "(not a valid template arg|no matching func|pointer-to-member)" }
+}
+
+int i = bar<A>(0);
+