From: Douglas Gregor Date: Thu, 19 Aug 2010 20:55:47 +0000 (+0000) Subject: Fix the source range of an anonymous namespace, from Jan Bierbaum X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21e09b63df2e1cc1e18749839bf21a6adb9a5b3a;p=clang Fix the source range of an anonymous namespace, from Jan Bierbaum git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111561 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index fff37d98e0..1958095783 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -3283,8 +3283,9 @@ Sema::DeclPtrTy Sema::ActOnStartNamespaceDef(Scope *NamespcScope, 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();