From f5c9a158c160f0daa4adaf5a0c0bb7e8ac01a897 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Fri, 26 Mar 2010 11:27:22 +0100
Subject: [PATCH] Use the start of the template-argument as to key for
 template-arguments cache.

---
 src/shared/cplusplus/Parser.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp
index d36226ce25d..a125683aff2 100644
--- a/src/shared/cplusplus/Parser.cpp
+++ b/src/shared/cplusplus/Parser.cpp
@@ -820,6 +820,8 @@ Parser::TemplateArgumentListEntry *Parser::templateArgumentListEntry(unsigned to
 
 bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
 {
+    DEBUG_THIS_RULE();
+
     if (TemplateArgumentListEntry *entry = templateArgumentListEntry(cursor())) {
         rewind(entry->cursor);
         node = entry->ast;
@@ -852,11 +854,11 @@ bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
             }
         }
 
-        _templateArgumentList.insert(std::make_pair(cursor(), TemplateArgumentListEntry(start, cursor(), node)));
+        _templateArgumentList.insert(std::make_pair(start, TemplateArgumentListEntry(start, cursor(), node)));
         return true;
     }
 
-    _templateArgumentList.insert(std::make_pair(cursor(), TemplateArgumentListEntry(start, cursor(), 0)));
+    _templateArgumentList.insert(std::make_pair(start, TemplateArgumentListEntry(start, cursor(), 0)));
 
     return false;
 }
-- 
GitLab