summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/defarg1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/defarg1.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/defarg1.C28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/defarg1.C b/gcc/testsuite/g++.old-deja/g++.other/defarg1.C
new file mode 100644
index 000000000..773336ca0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg1.C
@@ -0,0 +1,28 @@
+// { dg-do assemble }
+
+int f (int x)
+{
+ extern void g (int i = f (x)); // { dg-error "" } default argument uses local
+
+ g();
+
+ return 0;
+}
+
+int f (void);
+
+int h1 (int (*)(int) = f);
+int h2 (int (*)(double) = f); // { dg-error "" } no matching f
+
+template <class T>
+int j (T t)
+{
+ extern void k (int i = j (t)); // { dg-error "" } default argument uses local
+
+ k ();
+
+ return 0;
+}
+
+template int j (double);
+