diff --git a/src/shared/cplusplus/AST.h b/src/shared/cplusplus/AST.h index ecb0ddc3fb9..0b957ede817 100644 --- a/src/shared/cplusplus/AST.h +++ b/src/shared/cplusplus/AST.h @@ -1194,6 +1194,9 @@ public: SpecifierAST *attributes; DeclarationAST *linkage_body; +public: // annotations + Namespace *namespace_symbol; + public: virtual unsigned firstToken() const; virtual unsigned lastToken() const; diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp index 610d57626f4..48e6cd40fa2 100644 --- a/src/shared/cplusplus/CheckDeclaration.cpp +++ b/src/shared/cplusplus/CheckDeclaration.cpp @@ -286,6 +286,7 @@ bool CheckDeclaration::visit(NamespaceAST *ast) Identifier *id = identifier(ast->identifier_token); Name *namespaceName = control()->nameId(id); Namespace *ns = control()->newNamespace(ast->firstToken(), namespaceName); + ast->namespace_symbol = ns; _scope->enterSymbol(ns); semantic()->check(ast->linkage_body, ns->members()); // ### we'll do the merge later.