summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-04-27 14:10:57 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-04-27 14:10:57 +0000
commit8eab584388f3655416fb1e981fae4e51b0393ad6 (patch)
treef777cbab57e05daec8e44b6751e4aae1917c1067 /clang
parent081148986a60a761ac7528a9a132cab2ec70273b (diff)
downloadbcm5719-llvm-8eab584388f3655416fb1e981fae4e51b0393ad6.tar.gz
bcm5719-llvm-8eab584388f3655416fb1e981fae4e51b0393ad6.zip
Call ExitScope before ActOnFinishNamespaceDef.
This is the same for functions and it's preferable to have the namespace as DeclContext during ActOnPopScope. llvm-svn: 50322
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 5d49f4dd59a..475fb25842d 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -74,11 +74,12 @@ Parser::DeclTy *Parser::ParseNamespace(unsigned Context) {
while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof))
ParseExternalDeclaration();
+ // Leave the namespace scope.
+ ExitScope();
+
SourceLocation RBrace = MatchRHSPunctuation(tok::r_brace, LBrace);
Actions.ActOnFinishNamespaceDef(NamespcDecl, RBrace);
- ExitScope();
-
return NamespcDecl;
} else {
OpenPOWER on IntegriCloud