[PATCH] D82086: [AST][RecoveryExpr] Fix a crash: don't attach error-type base specifiers.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 18 06:30:12 PDT 2020
hokein marked an inline comment as done.
hokein added inline comments.
================
Comment at: clang/test/SemaCXX/invalid-template-base-specifier.cpp:6
+template <typename T>
+struct Crash : decltype(Foo(T())) { // expected-error {{no matching function for call to 'Foo'}}
+ Crash(){};
----------------
to explain what's happening here:
- when parsing this primary template class decl, we'll keep this base specifier (whose type is a normal dependent type, `DecltypeType 'decltype(Foo(T()))' dependent`)
- later clang instantiates `Crash<int>` (creating a ClassTemplateSpecializationDecl), which will subst the base specifier with an instantiated base specifier (the type is `DecltypeType decltype(<recovery-expr>(Foo, int()))` ), and the instantiated specifier is passed the sanity checks (`CheckBaseSpecifier`), and gets attached to the ClassTemplateSpecializationDecl.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82086/new/
https://reviews.llvm.org/D82086
More information about the cfe-commits
mailing list