diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-05-26 14:10:38 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-05-26 13:52:36 +0000 |
commit | fb59c70dcb1ace439cf9a03e95d90dd34dbe9584 (patch) | |
tree | 0a1b736b72e743c9635888967eeca48987eb8a19 /src/libs/3rdparty/cplusplus/Bind.cpp | |
parent | 809f7c6cfdb156e4084ee91023cb35ed51d55803 (diff) |
CppEditor: Revert changes to parseExpressionStatement()
Amends c8f29b9e0148202ab1959466e14fa23411fd8214.
It turns out that there are contexts where we want to parse an
expression statement even with the semicolon missing (e.g. completion on
incomplete code).
So leave the existing functions unchanged and do the thorough check
afterwards in parseIfStatement().
Change-Id: Id6209ef1abfe9d155c5b9381e6ae655cc721feb2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Bind.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Bind.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libs/3rdparty/cplusplus/Bind.cpp b/src/libs/3rdparty/cplusplus/Bind.cpp index e3d38a09a8..c85d401c49 100644 --- a/src/libs/3rdparty/cplusplus/Bind.cpp +++ b/src/libs/3rdparty/cplusplus/Bind.cpp @@ -1528,9 +1528,7 @@ bool Bind::visit(IfStatementAST *ast) ast->symbol = block; Scope *previousScope = switchScope(block); - if (ast->initDecl) - this->declaration(ast->initDecl); - else if (ast->initStmt) + if (ast->initStmt) this->statement(ast->initStmt); /*ExpressionTy condition =*/ this->expression(ast->condition); this->statement(ast->statement); |