aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Names.h
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2016-11-03 11:19:38 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2016-11-04 11:45:33 +0000
commit624bfeb70b8b00e3ef822e574db31d0ff18f75b7 (patch)
tree4994a0e305c1579cfbdb5644e51337f9ff1d0a4d /src/libs/3rdparty/cplusplus/Names.h
parent6494278d7062db4ff5692cb49ac92b81e0e9bc35 (diff)
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 <pgorszkowski@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Names.h')
-rw-r--r--src/libs/3rdparty/cplusplus/Names.h3
1 files changed, 0 insertions, 3 deletions
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<const TemplateNameId *, const TemplateNameId *, bool> {