diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index a55a9e95eb1f23893ad0637f9420a775f5cf9ed8..78eaea92d6b414f69c1eebc41d914b6434894ace 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -357,13 +357,17 @@ protected:
 
     virtual bool visit(TemplateIdAST *ast)
     {
-        Identifier *id = identifier(ast->identifier_token);
-        if (id == _id) {
+        if (_id == identifier(ast->identifier_token)) {
             LookupContext context = currentContext(ast);
             const QList<Symbol *> candidates = context.resolve(ast->name);
             reportResult(ast->identifier_token, candidates);
         }
 
+        for (TemplateArgumentListAST *template_arguments = ast->template_arguments;
+             template_arguments; template_arguments = template_arguments->next) {
+            accept(template_arguments->template_argument);
+        }
+
         return false;
     }