Commit 40f1e342 by Jason Merrill

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
parent 5840d6e4
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. Lwis <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> 2000-06-23 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
* parse.y (template_arg): Convert TEMPLATE_DECL * parse.y (template_arg): Convert TEMPLATE_DECL
......
...@@ -219,7 +219,7 @@ parse.o : $(PARSE_C) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \ ...@@ -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) \ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'` `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_H) : $(PARSE_C)
$(PARSE_C) : $(srcdir)/parse.y $(PARSE_C) : $(srcdir)/parse.y
@echo $(CONFLICTS) @echo $(CONFLICTS)
......
...@@ -2369,6 +2369,7 @@ push_namespace (name) ...@@ -2369,6 +2369,7 @@ push_namespace (name)
level is set elsewhere. */ level is set elsewhere. */
if (!global) if (!global)
{ {
DECL_CONTEXT (d) = FROB_CONTEXT (current_namespace);
d = pushdecl (d); d = pushdecl (d);
pushlevel (0); pushlevel (0);
declare_namespace_level (); declare_namespace_level ();
...@@ -3829,8 +3830,6 @@ pushdecl (x) ...@@ -3829,8 +3830,6 @@ pushdecl (x)
&& !(TREE_CODE (x) == VAR_DECL && DECL_EXTERNAL (x)) && !(TREE_CODE (x) == VAR_DECL && DECL_EXTERNAL (x))
&& !DECL_CONTEXT (x)) && !DECL_CONTEXT (x))
DECL_CONTEXT (x) = current_function_decl; 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, /* If this is the declaration for a namespace-scope function,
but the declaration itself is in a local scope, mark the but the declaration itself is in a local scope, mark the
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2872,6 +2872,12 @@ complex_direct_notype_declarator: ...@@ -2872,6 +2872,12 @@ complex_direct_notype_declarator:
{ $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); } { $$ = build_parse_node (ARRAY_REF, $$, NULL_TREE); }
| notype_qualified_id | notype_qualified_id
{ enter_scope_of ($1); } { 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 | nested_name_specifier notype_template_declarator
{ got_scope = NULL_TREE; { got_scope = NULL_TREE;
$$ = build_parse_node (SCOPE_REF, $1, $2); $$ = build_parse_node (SCOPE_REF, $1, $2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment