From 624bfeb70b8b00e3ef822e574db31d0ff18f75b7 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 3 Nov 2016 11:19:38 +0100 Subject: C++: Remove concurrent access to TemplateNameId The modification of the TemplateNameId changed "global state" because the TemplateNameId is potentially accessed by multiple threads doing lookup (access to same document and thus same symbol names). Depending on the thread scheduling and access to ClassOrNamespace::_specializations, the changed TemplateNameId "suddenly" led to inconsistent results of TemplateNameId::Compare and thus broke the std::map assertions. Get rid of the const_cast, the setter and simply construct a temporary TemplateNameId with isSpecializaton = true. Task-number: QTCREATORBUG-14911 Change-Id: Ie381d132cc0d06af351ace4257773637d1ebee4e Reviewed-by: Przemyslaw Gorszkowski Reviewed-by: Orgad Shaneh --- src/libs/3rdparty/cplusplus/Names.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/libs/3rdparty/cplusplus') diff --git a/src/libs/3rdparty/cplusplus/Names.h b/src/libs/3rdparty/cplusplus/Names.h index eaf8e956d4..41f3e761b4 100644 --- a/src/libs/3rdparty/cplusplus/Names.h +++ b/src/libs/3rdparty/cplusplus/Names.h @@ -99,9 +99,6 @@ public: TemplateArgumentIterator firstTemplateArgument() const { return _templateArguments.begin(); } TemplateArgumentIterator lastTemplateArgument() const { return _templateArguments.end(); } bool isSpecialization() const { return _isSpecialization; } - // this is temporary solution needed in ClassOrNamespace::nestedType - // when we try to find correct specialization for instantiation - void setIsSpecialization(bool isSpecialization) { _isSpecialization = isSpecialization; } // Comparator needed to distinguish between two different TemplateNameId(e.g.:used in std::map) struct Compare: std::binary_function { -- cgit v1.2.3