summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/default1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/default1.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/default1.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/default1.C b/gcc/testsuite/g++.old-deja/g++.jason/default1.C
new file mode 100644
index 000000000..afbac13bf
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/default1.C
@@ -0,0 +1,16 @@
+// { dg-do assemble }
+// PRMS Id: 5204
+// Bug: g++ bashes the type of add_sym with the type of add, so calling it
+// with one parameter generates an error.
+
+int add(int const &symbol,
+ const unsigned char flags=(void*)0); // { dg-error "" } invalid default arg
+
+int add_sym(int const &symbol,
+ const unsigned char flags=0);
+
+int main()
+{
+ int fname;
+ add_sym(fname); // Guarantee a symbol exists
+}