aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-19 20:55:47 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-19 20:55:47 +0000
commit21e09b63df2e1cc1e18749839bf21a6adb9a5b3a (patch)
tree4b2227fba504e7f1acc430ac7a36f38bc338b609
parent41a621d00e974829b75ff95cdff556755116dea1 (diff)
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
-rw-r--r--lib/Sema/SemaDeclCXX.cpp5
1 files changed, 3 insertions, 2 deletions
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();