Fix compiler crash when an expression parsed in the tentative parsing and must be...
authorAlexey Bataev <a.bataev@hotmail.com>
Fri, 29 May 2020 21:56:07 +0000 (17:56 -0400)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 2 Jun 2020 18:27:33 +0000 (14:27 -0400)
commit2f7269b6773de2750f9cd1417ef5f21cd6cf7a91
tree2cf8d5045d2fd8f53076fd410eb4255cf0c4628b
parentb78b98491adad1390c23a78a1d207d965d5c88f3
Fix compiler crash when an expression parsed in the tentative parsing and must be claimed in the another evaluation context.

Summary:
Clang crashes when trying to finish function body. MaybeODRUseExprs is
not empty because of const static data member parsed in outer evaluation
context, upon call for isTypeIdInParens() function. It builds
annot_primary_expr, later parsed in ParseConstantExpression() in
inner constant expression evaluation context.

Reviewers: rjmccall, rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80925
clang/include/clang/Basic/TokenKinds.def
clang/lib/Parse/ParseExpr.cpp
clang/lib/Parse/ParseTentative.cpp
clang/lib/Parse/Parser.cpp
clang/test/AST/alignas_maybe_odr_cleanup.cpp [new file with mode: 0644]