This revision was automatically updated to reflect the committed changes.
hokein marked an inline comment as done.
Closed by commit rG89d9912cbf45: [AST] dont invaliate VarDecl when the
initializer contains errors. (authored by hokein).
Changed prior to commit:
https://reviews.llvm.org/D78116?v
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
oops, meant to approve
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78116/new/
https://reviews.llvm.org/D78116
___
sammccall added a comment.
Most of the new diagnostics look good, as you say.
I'm okay with the regression around foreach loops, given that:
- per rsmith, the mechanism behind this diagnostic was misdesigned (relying on
initializer making things invalid)
- it's a C++-only features and we should
hokein added inline comments.
Comment at: clang/lib/Sema/SemaDecl.cpp:11998
ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, &DclT);
if (Result.isInvalid()) {
+ auto RecoveryExpr =
sammccall wrote:
> if the variable is an undeduced au
hokein updated this revision to Diff 258169.
hokein marked 5 inline comments as done.
hokein added a comment.
address comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78116/new/
https://reviews.llvm.org/D78116
Files:
clang/lib/Sema/SemaDec
sammccall added inline comments.
Comment at: clang/lib/Sema/SemaDecl.cpp:11998
ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, &DclT);
if (Result.isInvalid()) {
+ auto RecoveryExpr =
if the variable is an undeduced auto (and the type
hokein created this revision.
hokein added a reviewer: sammccall.
Herald added a project: clang.
This might be splitted into 2 separate patchs:
1. the initializer of a variable should play no part in decl "invalid" bit;
2. preserve the exprs in an error initializer via recovery exprs;
if we do 1