aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 618ba0d..4ea7d43 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-25 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (grokdeclarator): Set context of namespace scope
+ TYPE_DECLS.
+
2001-04-24 Zack Weinberg <zackw@stanford.edu>
* cp/optimize.c: Include hashtab.h.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 834e2dc..ea37eb4 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -11035,8 +11035,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
decl = build_lang_decl (TYPE_DECL, declarator, type);
}
else
- decl = build_decl (TYPE_DECL, declarator, type);
-
+ {
+ decl = build_decl (TYPE_DECL, declarator, type);
+ if (!current_function_decl)
+ DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
+ }
+
/* If the user declares "typedef struct {...} foo" then the
struct will have an anonymous name. Fill that name in now.
Nothing can refer to it, so nothing needs know about the name