diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-12-22 23:57:08 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-12-22 23:57:08 +0000 |
commit | 7813d14ccc5089fc5ef8eceb5377f41ab6a9844d (patch) | |
tree | bfd19fff8d2b9d5fc60b710cb3426bd7f1df5b92 /gcc/cp | |
parent | 1c8cfe03512a84981824b03079a09237503e3898 (diff) | |
download | gcc-7813d14ccc5089fc5ef8eceb5377f41ab6a9844d.zip gcc-7813d14ccc5089fc5ef8eceb5377f41ab6a9844d.tar.gz gcc-7813d14ccc5089fc5ef8eceb5377f41ab6a9844d.tar.bz2 |
re PR c++/12862 (Conflicts Between typedefs/enums and Namespace Member Declarations)
* c-common.c (flag_external_templates): Remove.
(flag_alt_external_templates): Likewise.
* c-common.h (flag_external_templates): Remove.
(flag_alt_external_templates): Likewise.
* c-opts.c (c_common_handle_option): Unsupport
-falt-external-templates and -ftemplates.
* doc/invoke.texi: Remove mention of -fexternal-templates and
-falt-external-templates.
* decl.c (start_function): Do not check
flag_alt_external_templates or flag_external_templates.
* decl2.c (warn_if_unknown_interface): Likewise.
* lex.c (extract_interface_info): Likewise.
* pt.c (lookup_template_class): Likewise.
PR c++/12862
* name-lookup.c (pushdecl): Look up all namespace-scope entities
in their corresponding namespace.
* g++.old-deja/g++.jason/template18.C: Remove.
* g++.old-deja/g++.jason/template37.C: Likewise.
PR c++/12862
* g++.dg/lookup/ns1.C: New test.
From-SVN: r74954
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/decl.c | 6 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 19 | ||||
-rw-r--r-- | gcc/cp/lex.c | 13 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 60 |
6 files changed, 19 insertions, 92 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4e4864fd..9e39313 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,15 @@ 2003-12-22 Mark Mitchell <mark@codesourcery.com> + * decl.c (start_function): Do not check + flag_alt_external_templates or flag_external_templates. + * decl2.c (warn_if_unknown_interface): Likewise. + * lex.c (extract_interface_info): Likewise. + * pt.c (lookup_template_class): Likewise. + + PR c++/12862 + * name-lookup.c (pushdecl): Look up all namespace-scope entities + in their corresponding namespace. + PR c++/12397 * typeck.c (finish_class_member_access_expr): Don't tree IDENTIFIER_NODEs as non-dependent expressions. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c4b9df7..09b0022 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10310,8 +10310,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) If it belongs to someone else's interface, it is also external. This only affects inlines and template instantiations. */ else if (interface_unknown == 0 - && (! DECL_TEMPLATE_INSTANTIATION (decl1) - || flag_alt_external_templates)) + && ! DECL_TEMPLATE_INSTANTIATION (decl1)) { if (DECL_DECLARED_INLINE_P (decl1) || DECL_TEMPLATE_INSTANTIATION (decl1) @@ -10332,8 +10331,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) DECL_INTERFACE_KNOWN (decl1) = 1; } else if (interface_unknown && interface_only - && (! DECL_TEMPLATE_INSTANTIATION (decl1) - || flag_alt_external_templates)) + && ! DECL_TEMPLATE_INSTANTIATION (decl1)) { /* If MULTIPLE_SYMBOL_SPACES is defined and we saw a #pragma interface, we will have interface_only set but not diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 726251f..92b661d 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -167,23 +167,8 @@ warn_if_unknown_interface (tree decl) if (already_warned++) return; - if (flag_alt_external_templates) - { - tree til = tinst_for_decl (); - location_t saved_loc = input_location; - - if (til) - { - input_line = TINST_LINE (til); - input_filename = TINST_FILE (til); - } - warning ("template `%#D' instantiated in file without #pragma interface", - decl); - input_location = saved_loc; - } - else - cp_warning_at ("template `%#D' defined in file without #pragma interface", - decl); + cp_warning_at ("template `%#D' defined in file without #pragma interface", + decl); } /* A subroutine of the parser, to handle a component list. */ diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index b2d2f1c..d22f5b0 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -436,18 +436,9 @@ cxx_init (void) void extract_interface_info (void) { - struct c_fileinfo *finfo = 0; - - if (flag_alt_external_templates) - { - tree til = tinst_for_decl (); - - if (til) - finfo = get_fileinfo (TINST_FILE (til)); - } - if (!finfo) - finfo = get_fileinfo (input_filename); + struct c_fileinfo *finfo; + finfo = get_fileinfo (input_filename); interface_only = finfo->interface_only; interface_unknown = finfo->interface_unknown; } diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index f19987d..0be758f 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -590,8 +590,7 @@ pushdecl (tree x) /* In case this decl was explicitly namespace-qualified, look it up in its namespace context. */ - if (TREE_CODE (x) == VAR_DECL && DECL_NAMESPACE_SCOPE_P (x) - && namespace_bindings_p ()) + if (DECL_NAMESPACE_SCOPE_P (x) && namespace_bindings_p ()) t = namespace_binding (name, DECL_CONTEXT (x)); else t = lookup_name_current_level (name); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d8b953a..e7a8863 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4485,19 +4485,7 @@ lookup_template_class (tree d1, is set up. */ if (TREE_CODE (t) != ENUMERAL_TYPE) DECL_NAME (type_decl) = classtype_mangled_name (t); - if (!is_partial_instantiation) - { - /* For backwards compatibility; code that uses - -fexternal-templates expects looking up a template to - instantiate it. I think DDD still relies on this. - (jason 8/20/1998) */ - if (TREE_CODE (t) != ENUMERAL_TYPE - && flag_external_templates - && CLASSTYPE_INTERFACE_KNOWN (TREE_TYPE (template)) - && ! CLASSTYPE_INTERFACE_ONLY (TREE_TYPE (template))) - add_pending_template (t); - } - else + if (is_partial_instantiation) /* If the type makes use of template parameters, the code that generates debugging information will crash. */ DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1; @@ -5279,24 +5267,7 @@ instantiate_class_template (tree type) args = inner_args; } - if (flag_external_templates) - { - if (flag_alt_external_templates) - { - CLASSTYPE_INTERFACE_ONLY (type) = interface_only; - SET_CLASSTYPE_INTERFACE_UNKNOWN_X (type, interface_unknown); - } - else - { - CLASSTYPE_INTERFACE_ONLY (type) = CLASSTYPE_INTERFACE_ONLY (pattern); - SET_CLASSTYPE_INTERFACE_UNKNOWN_X - (type, CLASSTYPE_INTERFACE_UNKNOWN (pattern)); - } - } - else - { - SET_CLASSTYPE_INTERFACE_UNKNOWN (type); - } + SET_CLASSTYPE_INTERFACE_UNKNOWN (type); /* Set the input location to the template definition. This is needed if tsubsting causes an error. */ @@ -8642,9 +8613,6 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) template, not the most general template. */ DECL_TI_TEMPLATE (fndecl) = tmpl; - if (flag_external_templates) - add_pending_template (fndecl); - /* If we've just instantiated the main entry point for a function, instantiate all the alternate entry points as well. We do this by cloning the instantiation of the main entry point, not by @@ -10529,9 +10497,6 @@ do_decl_instantiation (tree decl, tree storage) return; } - if (flag_external_templates) - return; - if (storage == NULL_TREE) ; else if (storage == ridpointers[(int) RID_EXTERN]) @@ -10600,11 +10565,6 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) complete_type (t); - /* With -fexternal-templates, explicit instantiations are treated the same - as implicit ones. */ - if (flag_external_templates) - return; - if (!COMPLETE_TYPE_P (t)) { if (complain & tf_error) @@ -10987,22 +10947,6 @@ instantiate_decl (tree d, int defer_ok) else repo_template_used (d); - if (flag_external_templates && ! DECL_INTERFACE_KNOWN (d)) - { - if (flag_alt_external_templates) - { - if (interface_unknown) - warn_if_unknown_interface (d); - } - else if (DECL_INTERFACE_KNOWN (code_pattern)) - { - DECL_INTERFACE_KNOWN (d) = 1; - DECL_NOT_REALLY_EXTERN (d) = ! DECL_EXTERNAL (code_pattern); - } - else - warn_if_unknown_interface (code_pattern); - } - if (at_eof) import_export_decl (d); } |