From 7f04af17a1adc5dd9b0a486d879e9150244cc7f8 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Thu, 12 Aug 2010 11:57:38 +0200
Subject: [PATCH] Mark the elaborated type specifiers.

---
 src/plugins/cppeditor/cppchecksymbols.cpp | 17 +++++++++++++++++
 src/plugins/cppeditor/cppchecksymbols.h   |  1 +
 2 files changed, 18 insertions(+)

diff --git a/src/plugins/cppeditor/cppchecksymbols.cpp b/src/plugins/cppeditor/cppchecksymbols.cpp
index 1f968d27533..6d8a2e3905d 100644
--- a/src/plugins/cppeditor/cppchecksymbols.cpp
+++ b/src/plugins/cppeditor/cppchecksymbols.cpp
@@ -480,6 +480,23 @@ bool CheckSymbols::visit(NamedTypeSpecifierAST *)
     return true;
 }
 
+bool CheckSymbols::visit(ElaboratedTypeSpecifierAST *ast)
+{
+    accept(ast->attribute_list);
+
+    if (ast->name) {
+        if (const Name *name = ast->name->name) {
+            if (name->isNameId() || name->isTemplateNameId()) {
+                addUse(ast->name, Use::Type);
+                return false;
+            }
+        }
+    }
+
+    accept(ast->name);
+    return false;
+}
+
 bool CheckSymbols::visit(MemberAccessAST *ast)
 {
     accept(ast->base_expression);
diff --git a/src/plugins/cppeditor/cppchecksymbols.h b/src/plugins/cppeditor/cppchecksymbols.h
index 848b18365ad..83e3f5ed52f 100644
--- a/src/plugins/cppeditor/cppchecksymbols.h
+++ b/src/plugins/cppeditor/cppchecksymbols.h
@@ -130,6 +130,7 @@ protected:
     virtual bool visit(UsingDirectiveAST *);
     virtual bool visit(SimpleDeclarationAST *);
     virtual bool visit(NamedTypeSpecifierAST *);
+    virtual bool visit(ElaboratedTypeSpecifierAST *ast);
 
     virtual bool visit(EnumeratorAST *);
 
-- 
GitLab