diff options
| author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-25 08:31:19 +0000 |
|---|---|---|
| committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-25 08:31:19 +0000 |
| commit | b04d77fe940d96454c3dd823918022b8ccd43e0e (patch) | |
| tree | ef721534e660501653ea55caa7abccbc52394844 /gcc/cp/decl.c | |
| parent | df9c72281a03d2f1250fbed5fcb69df5816fa116 (diff) | |
| download | ppe42-gcc-b04d77fe940d96454c3dd823918022b8ccd43e0e.tar.gz ppe42-gcc-b04d77fe940d96454c3dd823918022b8ccd43e0e.zip | |
cp:
* decl.c (grokdeclarator): Set context of namespace scope
TYPE_DECLS.
testsuite:
* g++.old-deja/g++.ns/type2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41533 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
| -rw-r--r-- | gcc/cp/decl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 834e2dcd5da..ea37eb45c0d 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 |

