forked from qt-creator/qt-creator
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>
This commit is contained in:
25
src/libs/3rdparty/cplusplus/ASTMatcher.cpp
vendored
25
src/libs/3rdparty/cplusplus/ASTMatcher.cpp
vendored
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user