]> granicus.if.org Git - clang/commitdiff
Call ExitScope before ActOnFinishNamespaceDef.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 27 Apr 2008 14:10:57 +0000 (14:10 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 27 Apr 2008 14:10:57 +0000 (14:10 +0000)
This is the same for functions and it's preferable to have the namespace as DeclContext during ActOnPopScope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50322 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp

index 5d49f4dd59af6d07e6f3982423809a634ce1f7de..475fb25842d2e84055408e415ebcd67e400fad4a 100644 (file)
@@ -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.\r
+    ExitScope();\r
+\r
     SourceLocation RBrace = MatchRHSPunctuation(tok::r_brace, LBrace);
     Actions.ActOnFinishNamespaceDef(NamespcDecl, RBrace);
 
-    ExitScope();
-
     return NamespcDecl;
     
   } else {