forked from qt-creator/qt-creator
C++: Support __thread and thread_local
Task-number: QTCREATORBUG-7679 Change-Id: I794f52b2bcfb6c78ceef86ec53b6ed32b3d53d9f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
06612ece77
commit
eac518aee6
36
src/libs/3rdparty/cplusplus/Keywords.cpp
vendored
36
src/libs/3rdparty/cplusplus/Keywords.cpp
vendored
@@ -803,6 +803,17 @@ static inline int classify8(const char *s, LanguageFeatures features)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s[3] == 'h') {
|
||||
if (s[4] == 'r') {
|
||||
if (s[5] == 'e') {
|
||||
if (s[6] == 'a') {
|
||||
if (s[7] == 'd') {
|
||||
return T___THREAD;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1443,6 +1454,31 @@ static inline int classify12(const char *s, LanguageFeatures features)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (features.cxx11Enabled && s[0] == 't') {
|
||||
if (s[1] == 'h') {
|
||||
if (s[2] == 'r') {
|
||||
if (s[3] == 'e') {
|
||||
if (s[4] == 'a') {
|
||||
if (s[5] == 'd') {
|
||||
if (s[6] == '_') {
|
||||
if (s[7] == 'l') {
|
||||
if (s[8] == 'o') {
|
||||
if (s[9] == 'c') {
|
||||
if (s[10] == 'a') {
|
||||
if (s[11] == 'l') {
|
||||
return T_THREAD_LOCAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return T_IDENTIFIER;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user