summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/crash-7.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/crash-7.C')
-rw-r--r--gcc/testsuite/g++.dg/other/crash-7.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/crash-7.C b/gcc/testsuite/g++.dg/other/crash-7.C
new file mode 100644
index 000000000..d5bc892c0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/crash-7.C
@@ -0,0 +1,19 @@
+// Origin: PR c++/42336
+// { dg-options "-std=c++0x -O2 -g" }
+// { dg-do compile }
+
+struct X {
+ void func() {}
+};
+
+template<typename T, void (X::*P)() = &T::func>
+void b(T) {}
+
+int main() {
+ b(X()); /* line 9 */
+ X().func();
+
+ return 0;
+}
+
+