summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/diagnostic/method1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/diagnostic/method1.C')
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/method1.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/diagnostic/method1.C b/gcc/testsuite/g++.dg/diagnostic/method1.C
new file mode 100644
index 000000000..8e1225d07
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/method1.C
@@ -0,0 +1,20 @@
+// PR c++/44627
+// { dg-do compile }
+
+struct A
+{
+ A *foo ();
+};
+
+template <class T>
+void
+bar ()
+{
+ A::foo ().anything; // { dg-error "request for member" }
+}
+
+void
+baz ()
+{
+ bar <int> ();
+}