[AST][RecoveryExpr] Popagate the error-bit from a VarDecl's initializer to DeclRefExpr.
authorHaojian Wu <hokein.wu@gmail.com>
Mon, 5 Oct 2020 08:35:29 +0000 (10:35 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Mon, 5 Oct 2020 08:35:29 +0000 (10:35 +0200)
commit3423d5c9da812b0076d1cf14e96ce453e35257b6
tree0977511fea439eeb7737a266d34b512e71ca3d34
parenta3caf7f6102dc863425f9714b099af58397f0cd2
[AST][RecoveryExpr] Popagate the error-bit from a VarDecl's initializer to DeclRefExpr.

The error-bit was missing, if a DeclRefExpr (which refers to a VarDecl
with a contains-errors initializer).

It could cause different violations in clang -- the DeclRefExpr is value-dependent,
but not contains-errors, `ABC<DeclRefExpr>` could produce a non-error
and non-dependent type in non-template context, which will lead to
crashes in constexpr evaluation.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D86048
clang/lib/AST/ComputeDependence.cpp
clang/test/Sema/invalid-member.cpp