summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/crash72.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/crash72.C')
-rw-r--r--gcc/testsuite/g++.dg/template/crash72.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/crash72.C b/gcc/testsuite/g++.dg/template/crash72.C
new file mode 100644
index 000000000..5ab536561
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash72.C
@@ -0,0 +1,25 @@
+// PR c++/29225
+// { dg-do compile }
+
+template <typename L, typename R> bool operator< (L x, R y);
+struct T { int t (); };
+class S {};
+
+struct U
+{
+ typedef int (T::* M) ();
+ M m;
+
+ bool operator() (S &x)
+ {
+ T a;
+ return (a.*m) < x; // { dg-error "invalid use of non-static member" }
+ }
+};
+
+void foo (S &x)
+{
+ U m;
+ m.m = &T::t;
+ m (x);
+}