[cfe-commits] r111561 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Douglas Gregor dgregor at apple.com
Thu Aug 19 13:55:47 PDT 2010


Author: dgregor
Date: Thu Aug 19 15:55:47 2010
New Revision: 111561

URL: http://llvm.org/viewvc/llvm-project?rev=111561&view=rev
Log:
Fix the source range of an anonymous namespace, from Jan Bierbaum

Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=111561&r1=111560&r2=111561&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Aug 19 15:55:47 2010
@@ -3283,8 +3283,9 @@
                                              IdentifierInfo *II,
                                              SourceLocation LBrace,
                                              AttributeList *AttrList) {
-  NamespaceDecl *Namespc =
-      NamespaceDecl::Create(Context, CurContext, IdentLoc, II);
+  // anonymous namespace starts at its left brace
+  NamespaceDecl *Namespc = NamespaceDecl::Create(Context, CurContext,
+    (II ? IdentLoc : LBrace) , II);
   Namespc->setLBracLoc(LBrace);
 
   Scope *DeclRegionScope = NamespcScope->getParent();





More information about the cfe-commits mailing list