summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/diagnostic/parm1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/diagnostic/parm1.C')
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/parm1.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/diagnostic/parm1.C b/gcc/testsuite/g++.dg/diagnostic/parm1.C
new file mode 100644
index 00000000000..2e553e2d4c5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/parm1.C
@@ -0,0 +1,11 @@
+// PR c++/44366
+// While printing the operand of sizeof We were trying to print f as the
+// scope of t, causing infinite recursion.
+
+template <typename T>
+void f(T t, int(*)[sizeof(t)])
+{
+ struct A { void g() {
+ foo; // { dg-error "foo" }
+ } };
+}