Commit Graph

4 Commits

Author SHA1 Message Date
Haojian Wu 3423d5c9da [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
2020-10-05 10:35:29 +02:00
Haojian Wu 28923dc2dd [AST][RecoveryExpr] Fix a crash on a field decl with invalid type.
Summary:
The field decl (in the testcase) was still valid, which results in a
valid RecordDecl, it led to crash when performing struct layout,
and computing struct size etc.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81913
2020-06-16 12:12:10 +02:00
Haojian Wu 6f428e09fb [AST] Fix crashes on decltype(recovery-expr).
Summary: We mark these decls as invalid.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77037
2020-03-30 14:56:33 +02:00
Sam McCall 47e7bdb107 Test that would have caught recovery-expr crashes in 0788acbccb. NFC 2020-03-26 18:43:29 +01:00