From 3ac4e05e374fe91891d27b240b60ea91308d7184 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <qtc-committer@nokia.com>
Date: Mon, 9 Feb 2009 12:00:06 +0100
Subject: [PATCH] Annotated NamespaceAST nodes.

---
 src/shared/cplusplus/AST.h                | 3 +++
 src/shared/cplusplus/CheckDeclaration.cpp | 1 +
 2 files changed, 4 insertions(+)

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.
 
-- 
GitLab