summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-21 14:29:33 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-21 14:29:33 +0000
commit74410faa1cd2c3138132adc2a839c15e685cddb7 (patch)
treebaf338e3c55393da72e8f2f9e50fa81ec5ca6a34 /gcc/testsuite
parent6eb48339445cd991b1ee97a7bb60b49c2a380b8b (diff)
downloadppe42-gcc-74410faa1cd2c3138132adc2a839c15e685cddb7.tar.gz
ppe42-gcc-74410faa1cd2c3138132adc2a839c15e685cddb7.zip
* cp-tree.h (PARM_DECL_EXPR): Delete.
(convert_default_arg): Change prototype. (check_default_argument): Declare. (search_tree): Likewise. * call.c (convert_default_arg): Take the function to which the default argument belongs as a parameter, and do any necessary instantiation here, instead of ... (build_over_call): Here. * decl.c (local_variable_p): New function. (check_default_argument): Likewise, split out and tidied from ... (grokparms): Here. * error.c (dump_expr): Don't set PARM_DECL_EXPR. * pt.c (tsubst_call_declarator_parms): New function. (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing with CALL_EXPRs, rather than trying to be clever. (tsubst): Use tsubst_call_declarator_parms. * tree.c (search_tree): Don't make it static. * typeck.c (convert_arguments): Use new interface to convert_default_arg. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24803 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-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 00000000000..68b07a510cc
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/defarg1.C
@@ -0,0 +1,28 @@
+// Build don't link:
+
+int f (int x)
+{
+ extern void g (int i = f (x)); // ERROR - default argument uses local
+
+ g();
+
+ return 0;
+}
+
+int f (void);
+
+int h1 (int (*)(int) = f);
+int h2 (int (*)(double) = f); // ERROR - no matching f
+
+template <class T>
+int j (T t)
+{
+ extern void k (int i = j (t)); // ERROR - default argument uses local
+
+ k ();
+
+ return 0;
+}
+
+template int j (double); // ERROR - instantiated from here
+
OpenPOWER on IntegriCloud