[AST][RecoveryExpr] Fix a crash: don't attach error-type base specifiers.
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 24 Jun 2020 08:02:06 +0000 (10:02 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 24 Jun 2020 08:13:46 +0000 (10:13 +0200)
commitf0084c3bcbc2f2e17ab1a24d19ac6738eb4c4263
tree94d8a2ef396d2762f8aa5281f80119756759e002
parent96d4ccf00c8f746aebb549288fac33dcbb15bc4b
[AST][RecoveryExpr] Fix a crash: don't attach error-type base specifiers.

Summary:
otherwise we'll run into code path which expects a good base specifiers,
and lead to crashes.

The crash only occurs in template instantiations (in non-template case,
the bad base specifiers are dropped during parsing.)

crash stacktrace:

```
clang: llvm-project/clang/lib/Sema/SemaInit.cpp:7864: clang::ExprResult clang::InitializationSequence::Perform(clang::Sema &, const clang::InitializedEntity &, const clang::InitializationKind &, clang::MultiExprArg, clang::QualType *): Assertion `Kind.getKind() == InitializationKind::IK_Copy || Kind.isExplicitCast() || Kind.getKind() == InitializationKind::IK_DirectList' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82086
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/SemaCXX/invalid-template-base-specifier.cpp [new file with mode: 0644]