decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace.

* decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace.
        (push_namespace): Set DECL_CONTEXT for a new NAMESPACE_DECL.

        * parse.y (complex_direct_notype_declarator): Support global_scope.
        * Makefile.in: Adjust conflict count.

From-SVN: r34686
This commit is contained in:
Jason Merrill 2000-06-24 18:17:18 -04:00
parent 5840d6e4f5
commit 40f1e34222
5 changed files with 3377 additions and 3335 deletions

View File

@ -1,3 +1,13 @@
2000-06-24 Jason Merrill <jason@redhat.com>
* decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace.
(push_namespace): Set DECL_CONTEXT for a new NAMESPACE_DECL.
2000-06-24 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* parse.y (complex_direct_notype_declarator): Support global_scope.
* Makefile.in: Adjust conflict count.
2000-06-23 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
* parse.y (template_arg): Convert TEMPLATE_DECL

View File

@ -219,7 +219,7 @@ parse.o : $(PARSE_C) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'`
CONFLICTS = expect 31 shift/reduce conflicts and 42 reduce/reduce conflicts.
CONFLICTS = expect 32 shift/reduce conflicts and 58 reduce/reduce conflicts.
$(PARSE_H) : $(PARSE_C)
$(PARSE_C) : $(srcdir)/parse.y
@echo $(CONFLICTS)

View File

@ -2369,6 +2369,7 @@ push_namespace (name)
level is set elsewhere. */
if (!global)
{
DECL_CONTEXT (d) = FROB_CONTEXT (current_namespace);
d = pushdecl (d);
pushlevel (0);
declare_namespace_level ();
@ -3829,8 +3830,6 @@ pushdecl (x)
&& !(TREE_CODE (x) == VAR_DECL && DECL_EXTERNAL (x))
&& !DECL_CONTEXT (x))
DECL_CONTEXT (x) = current_function_decl;
if (!DECL_CONTEXT (x))
DECL_CONTEXT (x) = FROB_CONTEXT (current_namespace);
/* If this is the declaration for a namespace-scope function,
but the declaration itself is in a local scope, mark the

File diff suppressed because it is too large Load Diff

View File

@ -2872,6 +2872,12 @@ complex_direct_notype_declarator:
{ $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); }
| notype_qualified_id
{ enter_scope_of ($1); }
| global_scope notype_qualified_id
{ enter_scope_of ($2); $$ = $2;}
| global_scope notype_unqualified_id
{ $$ = build_parse_node (SCOPE_REF, global_namespace, $2);
enter_scope_of ($$);
}
| nested_name_specifier notype_template_declarator
{ got_scope = NULL_TREE;
$$ = build_parse_node (SCOPE_REF, $1, $2);