aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-03-03 15:00:21 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2023-03-06 13:20:04 +0000
commit755d9769d81a5dc4e0b837650f9fab27a3f094ab (patch)
treec0ff4b3b9b3e16991f7903ceaddb2f6aa4aad9e1 /src/libs/3rdparty/cplusplus/ASTMatcher.cpp
parentdc8da57e6452ce4dbd97b1a53de8c297bd4e5bcf (diff)
CPlusPlus: Add support for coroutines
Also fix some concept-related bugs uncovered by the test case. Change-Id: Ia67c971026bcd85d9cc252f46cd4f56c2865d432 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/ASTMatcher.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/ASTMatcher.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libs/3rdparty/cplusplus/ASTMatcher.cpp b/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
index d39d0717c5..4567cd68a2 100644
--- a/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
+++ b/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
@@ -2277,6 +2277,26 @@ bool ASTMatcher::match(ThrowExpressionAST *node, ThrowExpressionAST *pattern)
return true;
}
+bool ASTMatcher::match(YieldExpressionAST *node, YieldExpressionAST *pattern)
+{
+ pattern->yield_token = node->yield_token;
+ if (!pattern->expression)
+ pattern->expression = node->expression;
+ else if (!AST::match(node->expression, pattern->expression, this))
+ return false;
+ return true;
+}
+
+bool ASTMatcher::match(AwaitExpressionAST *node, AwaitExpressionAST *pattern)
+{
+ pattern->await_token = node->await_token;
+ if (!pattern->castExpression)
+ pattern->castExpression = node->castExpression;
+ else if (!AST::match(node->castExpression, pattern->castExpression, this))
+ return false;
+ return true;
+}
+
bool ASTMatcher::match(NoExceptOperatorExpressionAST *node, NoExceptOperatorExpressionAST *pattern)
{
(void) node;
@@ -2398,6 +2418,11 @@ bool ASTMatcher::match(TemplateTypeParameterAST *node, TemplateTypeParameterAST
pattern->template_token = node->template_token;
+ if (!pattern->typeConstraint)
+ pattern->typeConstraint = node->typeConstraint;
+ else if (!AST::match(node->typeConstraint, pattern->typeConstraint, this))
+ return false;
+
pattern->less_token = node->less_token;
if (! pattern->template_parameter_list)