[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-21 Thread Haojian Wu via Phabricator via cfe-commits
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:

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-16 Thread Sam McCall via Phabricator via cfe-commits
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

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-16 Thread Sam McCall via Phabricator via cfe-commits
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

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:11998 ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, ); if (Result.isInvalid()) { + auto RecoveryExpr = sammccall wrote: > if the variable is an undeduced auto

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-16 Thread Haojian Wu via Phabricator via cfe-commits
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:

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-14 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:11998 ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, ); if (Result.isInvalid()) { + auto RecoveryExpr = if the variable is an undeduced auto (and the type of

[PATCH] D78116: [AST] dont invaliate VarDecl when the initializer contains errors.

2020-04-14 Thread Haojian Wu via Phabricator via cfe-commits
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