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

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 09:06:14 PDT 2020


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) only, we will regress the diagnostics (one big regression is that
we loose the "selected 'begin' function with iterator type" diagnostic in for-range stmt;
with 2) together, we don't have regressions (the new diagnostics seems to be
improved).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78116

Files:
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaStmt.cpp
  clang/test/AST/ast-dump-invalid-initialized.cpp
  clang/test/AST/ast-dump-recovery.cpp
  clang/test/CXX/special/class.copy/p11.0x.move.cpp
  clang/test/CXX/stmt.stmt/stmt.iter/stmt.ranged/p1.cpp
  clang/test/OpenMP/task_messages.cpp
  clang/test/SemaCXX/block-call.cpp
  clang/test/SemaCXX/constant-expression-cxx11.cpp
  clang/test/SemaCXX/cxx11-crashes.cpp
  clang/test/SemaCXX/cxx2a-explicit-bool.cpp
  clang/test/SemaCXX/for-range-dereference.cpp
  clang/test/SemaCXX/member-init.cpp
  clang/test/SemaObjCXX/parameterized_classes_arc.mm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78116.257355.patch
Type: text/x-patch
Size: 11183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200414/8f6f37b7/attachment.bin>


More information about the cfe-commits mailing list