[PATCH] D69330: [AST] Add RecoveryExpr to retain expressions on semantic errors
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 20 08:16:26 PST 2019
ilya-biryukov marked an inline comment as done.
ilya-biryukov added a comment.
@rsmith, could you also take a look at D65591 <https://reviews.llvm.org/D65591>?
It's really important to have the `containsError()` check in this patch that marks decls with undeduced types as invalid. Otherwise, they would have a "dependent auto type" and the constant evaluation code will fail when attempting to get sizes of those, e.g. when they're used inside `sizeof()`.
There's actually a test in clang that crashes if this is not done (`clang/test/SemaCXX/lambda-expressions.cpp`)
I have also realized doing typo-correction in `CreateRecoveryExpr` is a bad idea, the contract for typo correction is to run it at particular points (e.g. on full expressions) and it's unclear why recovery expressions should be another case for this context. All code attempting to create recovery expressions should already handle typo correction properly, so there's no need to cross these two features.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69330/new/
https://reviews.llvm.org/D69330
More information about the cfe-commits
mailing list