From 1c1e792fcfa29c103e0f5279eb65154133e2cae5 Mon Sep 17 00:00:00 2001 From: malte_langkabel Date: Wed, 15 Feb 2017 11:36:04 +0100 Subject: [PATCH] logic: anonymous namespace locations * removed special treatment of anonymous symbols when retrieving their source location. Now their source location is just the "{" character at the start of the namespace's scope. --- src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp | 2 +- src/test/CxxParserTestSuite.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp index d687c715..e89aaaed 100644 --- a/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxAstVisitorComponentIndexer.cpp @@ -312,7 +312,7 @@ void CxxAstVisitorComponentIndexer::visitNamespaceDecl(clang::NamespaceDecl* d) m_client->recordSymbol( getAstVisitor()->getDeclNameCache()->getValue(d), SYMBOL_NAMESPACE, - d->isAnonymousNamespace() ? ParseLocation() : getParseLocation(d->getLocation()), + getParseLocation(d->getLocation()), getParseLocation(d->getSourceRange()), utility::convertAccessSpecifier(d->getAccess()), utility::isImplicit(d) ? DEFINITION_IMPLICIT : DEFINITION_EXPLICIT diff --git a/src/test/CxxParserTestSuite.h b/src/test/CxxParserTestSuite.h index 3050191e..575be6ce 100644 --- a/src/test/CxxParserTestSuite.h +++ b/src/test/CxxParserTestSuite.h @@ -258,7 +258,7 @@ public: ); TS_ASSERT(utility::containsElement( - client->namespaces, "anonymous namespace (input.cc<1:1>) <1:1 3:1>" + client->namespaces, "anonymous namespace (input.cc<1:1>) <1:1 <2:1 2:1> 3:1>" )); }