aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/ASTMatcher.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/ASTMatcher.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/ASTMatcher.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/ASTMatcher.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/libs/3rdparty/cplusplus/ASTMatcher.cpp b/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
index d76180a8ca..321d14a263 100644
--- a/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
+++ b/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
@@ -117,6 +117,46 @@ bool ASTMatcher::match(GnuAttributeSpecifierAST *node, GnuAttributeSpecifierAST
return true;
}
+bool ASTMatcher::match(MsvcDeclspecSpecifierAST *node, MsvcDeclspecSpecifierAST *pattern)
+{
+ (void) node;
+ (void) pattern;
+
+ pattern->attribute_token = node->attribute_token;
+
+ pattern->lparen_token = node->lparen_token;
+
+ if (! pattern->attribute_list)
+ pattern->attribute_list = node->attribute_list;
+ else if (! AST::match(node->attribute_list, pattern->attribute_list, this))
+ return false;
+
+ pattern->rparen_token = node->rparen_token;
+
+ return true;
+}
+
+bool ASTMatcher::match(StdAttributeSpecifierAST *node, StdAttributeSpecifierAST *pattern)
+{
+ (void) node;
+ (void) pattern;
+
+ pattern->first_lbracket_token = node->first_lbracket_token;
+
+ pattern->second_lbracket_token = node->second_lbracket_token;
+
+ if (! pattern->attribute_list)
+ pattern->attribute_list = node->attribute_list;
+ else if (! AST::match(node->attribute_list, pattern->attribute_list, this))
+ return false;
+
+ pattern->first_rbracket_token = node->first_rbracket_token;
+
+ pattern->second_rbracket_token = node->second_rbracket_token;
+
+ return true;
+}
+
bool ASTMatcher::match(GnuAttributeAST *node, GnuAttributeAST *pattern)
{
(void) node;
@@ -1246,6 +1286,8 @@ bool ASTMatcher::match(IfStatementAST *node, IfStatementAST *pattern)
pattern->if_token = node->if_token;
+ pattern->constexpr_token = node->constexpr_token;
+
pattern->lparen_token = node->lparen_token;
if (! pattern->condition)