From 791bcb1c3ef79843c9663e9fb7c39357f3426305 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 19 Aug 1999 23:29:45 +0000 Subject: [PATCH] cp-tree.h: Declare flag_use_repository. * cp-tree.h: Declare flag_use_repository. * pt.c (do_decl_instantiation): Don't complain about duplicate instantiation with -frepo. (do_type_instantiation): Likewise. * decl2.c (lookup_arg_dependent): Note that we've already checked the current namespace. From-SVN: r28772 --- gcc/cp/ChangeLog | 12 ++++++++++++ gcc/cp/cp-tree.h | 4 ++++ gcc/cp/decl2.c | 12 ++++++++++-- gcc/cp/pt.c | 6 +++--- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 82d1a8bc2398..5c44b60af358 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +1999-08-19 Jason Merrill + + * cp-tree.h: Declare flag_use_repository. + * pt.c (do_decl_instantiation): Don't complain about duplicate + instantiation with -frepo. + (do_type_instantiation): Likewise. + +1999-08-14 Jason Merrill + + * decl2.c (lookup_arg_dependent): Note that we've already checked + the current namespace. + Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com) * gcc-2.95.1 Released. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 7d643078deeb..71809159ea45 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -543,6 +543,10 @@ extern int flag_guiding_decls; and class qualifiers. */ extern int flag_do_squangling; +/* Nonzero means generate separate instantiation control files and juggle + them at link time. */ +extern int flag_use_repository; + /* Nonzero if we want to issue diagnostics that the standard says are not required. */ extern int flag_optional_diags; diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 84f491f437cf..d6fb7bf90fad 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4892,11 +4892,19 @@ lookup_arg_dependent (name, fns, args) tree args; { struct arg_lookup k; + k.name = name; k.functions = fns; - k.namespaces = NULL_TREE; k.classes = NULL_TREE; - + + /* Note that we've already looked at the current namespace during normal + unqualified lookup, unless we found a decl in function scope. */ + if (fns && ! TREE_PERMANENT (OVL_CURRENT (fns))) + k.namespaces = NULL_TREE; + else + k.namespaces = scratch_tree_cons (current_decl_namespace (), + NULL_TREE, NULL_TREE); + push_scratch_obstack (); arg_assoc_args (&k, args); pop_obstacks (); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 47fa99a5c431..69dfa97e61ad 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8924,7 +8924,7 @@ do_decl_instantiation (declspecs, declarator, storage) We check DECL_INTERFACE_KNOWN so as not to complain when the first instantiation was `extern' and the second is not, and EXTERN_P for the opposite case. */ - if (DECL_INTERFACE_KNOWN (result) && !extern_p) + if (DECL_INTERFACE_KNOWN (result) && !extern_p && !flag_use_repository) cp_pedwarn ("duplicate explicit instantiation of `%#D'", result); /* If we've already instantiated the template, just return now. */ @@ -9052,8 +9052,8 @@ do_type_instantiation (t, storage) If CLASSTYPE_INTERFACE_ONLY, then the first explicit instantiation was `extern', and if EXTERN_P then the second is. Both cases are OK. */ - if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p) - cp_error ("duplicate explicit instantiation of `%#T'", t); + if (!CLASSTYPE_INTERFACE_ONLY (t) && !extern_p && !flag_use_repository) + cp_pedwarn ("duplicate explicit instantiation of `%#T'", t); /* If we've already instantiated the template, just return now. */ if (!CLASSTYPE_INTERFACE_ONLY (t)) -- 2.47.2