summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/bound-mem-fun.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/expr/bound-mem-fun.C')
-rw-r--r--gcc/testsuite/g++.dg/expr/bound-mem-fun.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/expr/bound-mem-fun.C b/gcc/testsuite/g++.dg/expr/bound-mem-fun.C
new file mode 100644
index 000000000..b31bba13c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/bound-mem-fun.C
@@ -0,0 +1,18 @@
+// Contributed by Dodji Seketeli <dodji@redhat.com>
+// Origin PR c++/38228
+// { dg-do compile }
+
+struct A
+{
+ A ();
+ template<typename T> A(T);
+};
+
+struct B
+{
+ int foo();
+};
+
+A a = B().*(&B::foo); // { dg-error "invalid use of non-static member function" }
+
+