aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@gcc.gnu.org>2009-04-23 13:15:33 +0200
committerDodji Seketeli <dodji@gcc.gnu.org>2009-04-23 13:15:33 +0200
commit111a28c29e1f0af6064dd1a3ba2f9eac09ad00eb (patch)
tree9cf794ed9aa81713d4ecea5e289646e8597a6fcf /gcc/testsuite
parentc1abd261d91caa67f71439292081b7299d4f5788 (diff)
downloadgcc-111a28c29e1f0af6064dd1a3ba2f9eac09ad00eb.zip
gcc-111a28c29e1f0af6064dd1a3ba2f9eac09ad00eb.tar.gz
gcc-111a28c29e1f0af6064dd1a3ba2f9eac09ad00eb.tar.bz2
re PR c++/38228 (ICE with invalid use of bound member function)
gcc/cp/ChangeLog: PR c++/38228 * pt.c (unify): Do not allow the result of a template argument deduction to be a METHOD_TYPE. * cvt.c (cp_convert): Report a meaningful error for non-valid use of pointer to member functions during conversions. * call.c (build_new_op): Report a meaningful error for non-valid use of pointer to member functions in binary expressions. * typeck.c (invalid_nonstatic_memfn_p): Do not crash when EXPR is NULL; gcc/testsuite/ChangeLog: PR c++/38228 * g++.dg/expr/bound-mem-fun.C: New test. From-SVN: r146646
Diffstat (limited to 'gcc/testsuite')
-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 0000000..9e699b6
--- /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" }
+
+