aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Keywords.cpp
diff options
context:
space:
mode:
authorVolodymyr Zibarov <gogan419@gmail.com>2020-05-14 23:07:05 +0300
committerVolodymyr Zibarov <gogan419@gmail.com>2020-05-29 12:39:28 +0000
commit9ee693ee229d28bd618e8dd44bc6b12750d43a29 (patch)
tree7a2a4dd6679fd3647228b5c39d1fc2724ff133a3 /src/libs/3rdparty/cplusplus/Keywords.cpp
parentbe97943372bc80d2440daa20cd658599d765b9a9 (diff)
C++: fix built-in code model to work with shared_ptr on MSVC 2017
These changes target Find Usages feature to work with shared_ptr. Improve libs/3rdparty/cplusplus and plugins/cplusplus: parse __declspec() attribute, call to variadic function template without specified template arguments, if constexpr, c++11 attributes [[value]], function templates with default parameters, resolve order for function vs template with default parameter, template operator->() with default arguments, template specialization with numeric values, find best partial specialization, fix partial specialization for non-first specialized argument Fixes: QTCREATORBUG-7866 Fixes: QTCREATORBUG-20781 Fixes: QTCREATORBUG-22857 Fixes: QTCREATORBUG-17825 Change-Id: I31a080f7729edfb2ee9650f1aff48daeba5a673b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Nikolai Kosjar <pinaceae.pinus@gmail.com>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Keywords.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/Keywords.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/libs/3rdparty/cplusplus/Keywords.cpp b/src/libs/3rdparty/cplusplus/Keywords.cpp
index 9fb6185c6f..1637333b42 100644
--- a/src/libs/3rdparty/cplusplus/Keywords.cpp
+++ b/src/libs/3rdparty/cplusplus/Keywords.cpp
@@ -1079,6 +1079,23 @@ static inline int classify9(const char *s, LanguageFeatures features)
}
}
}
+ else if (s[1] == 'd') {
+ if (s[2] == 'e') {
+ if (s[3] == 'c') {
+ if (s[4] == 'l') {
+ if (s[5] == 's') {
+ if (s[6] == 'p') {
+ if (s[7] == 'e') {
+ if (s[8] == 'c') {
+ return T__DECLSPEC;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
else if (features.cxx11Enabled && s[0] == 'c') {
if (s[1] == 'o') {
@@ -1178,11 +1195,20 @@ static inline int classify10(const char *s, LanguageFeatures features)
{
if (s[0] == '_') {
if (s[1] == '_') {
- if (features.cxxEnabled && s[2] == 'd') {
+ if (s[2] == 'd') {
if (s[3] == 'e') {
if (s[4] == 'c') {
if (s[5] == 'l') {
- if (s[6] == 't') {
+ if (s[6] == 's') {
+ if (s[7] == 'p') {
+ if (s[8] == 'e') {
+ if (s[9] == 'c') {
+ return T___DECLSPEC;
+ }
+ }
+ }
+ }
+ else if (features.cxxEnabled && s[6] == 't') {
if (s[7] == 'y') {
if (s[8] == 'p') {
if (s[9] == 'e') {