CPlusPlus: Fix mis-parsing array-related constructs

... as structured bindings.
Also add a safety check to Bind that might be needed for invalid code.
Amends ca00b874a7.

Change-Id: I7b174b80ad97ed7424f1e369b876c99acf7e95d2
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:
Christian Kandeler
2022-08-24 16:23:33 +02:00
parent 3172bba63c
commit fa13f48c2b
3 changed files with 30 additions and 20 deletions

View File

@@ -79,7 +79,7 @@ public:
bool parseSimpleDeclaration(DeclarationAST *&node, ClassSpecifierAST *declaringClass = nullptr);
bool parseDeclarationStatement(StatementAST *&node);
bool parseCoreDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass);
DecompositionDeclaratorAST *parseDecompositionDeclarator();
DecompositionDeclaratorAST *parseDecompositionDeclarator(SpecifierListAST *decl_specifier_list);
bool parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specifier_list, ClassSpecifierAST *declaringClass = nullptr);
bool parseDeleteExpression(ExpressionAST *&node);
bool parseDoStatement(StatementAST *&node);
@@ -317,6 +317,8 @@ public:
void clearTemplateArgumentList() { _templateArgumentList.clear(); }
private:
bool hasAuto(SpecifierListAST *decl_specifier_list) const;
TranslationUnit *_translationUnit;
Control *_control;
MemoryPool *_pool;