llvm-project/clang/test/SemaTemplate/concepts-GH86757.cpp
Haojian Wu a042fcbe45
[clang] Bailout when the substitution of template parameter mapping is invalid. (#86869)
Fixes #86757

We missed to handle the invalid case when substituting into the
parameter mapping of an constraint during normalization.
The constructor of `InstantiatingTemplate` will bail out (no
`CodeSynthesisContext` will be added to the instantiation stack) if
there was a fatal error, consequently we should stop doing any further
template instantiations.
2024-03-28 13:10:02 +01:00

14 lines
388 B
C++

// RUN: %clang_cc1 -std=c++20 -Wfatal-errors -verify %s
template <typename> int a;
template <typename... b> concept c = a<b...>;
template <typename> concept e = c<>;
// must be a fatal error to trigger the crash
undefined; // expected-error {{a type specifier is required for all declarations}}
template <typename d> concept g = e<d>;
template <g> struct h
template <g d>
struct h<d>;