[PATCH] D153296: [AST] Stop evaluate constant expression if the condition expression which in switch statement contains errors
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 22 12:04:51 PDT 2023
erichkeane added a comment.
Also needs a release note.
================
Comment at: clang/lib/AST/ExprConstant.cpp:4893
+ // Stop evaluate if E is a RecoveryExpr.
+ if (isa<RecoveryExpr>(E))
+ return false;
----------------
I'd probably suggest `E->containsErrors()` instead, to cover cases where we're not the 'root' of a recovery expr? So something like:
`switch(func_call(unknown_value))`
should create a dependent call expr, but would still contain errors.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153296/new/
https://reviews.llvm.org/D153296
More information about the cfe-commits
mailing list