summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/ptrmem2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/ptrmem2.C')
-rw-r--r--gcc/testsuite/g++.dg/template/ptrmem2.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/ptrmem2.C b/gcc/testsuite/g++.dg/template/ptrmem2.C
new file mode 100644
index 000000000..191904736
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ptrmem2.C
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 31 Dec 2001 <nathan@codesourcery.com>
+
+// We'd tsubst a pointer to member reference
+
+struct A {};
+
+template <typename T> T A::* Foo (); // { dg-message "note" }
+
+void Baz ()
+{
+ Foo <int &> (); // { dg-error "no matching function" "" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 14 }
+}