| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++26 %s |
| 2 |
|
| 3 |
namespace invalid_partial_spec { |
| 4 |
template <int> struct integer_sequence {}; |
| 5 |
template <int> struct array {}; |
| 6 |
template <int*> struct MetaValuesHelper; // expected-note {{template is declared here}} |
| 7 |
|
| 8 |
template <typename TupleName, TupleName kValues> |
| 9 |
struct MetaValuesHelper<kValues> { |
| 10 |
// expected-error@-1 {{class template partial specialization is not more specialized than the primary template}} |
| 11 |
template <int... Is> |
| 12 |
static array<undefined<Is>(kValues)...> MetaValuesFunc(integer_sequence<Is...>); |
| 13 |
// expected-note@-1 {{candidate template ignored: substitution failure [with Is = <0>]: use of undeclared identifier 'undefined'}} |
| 14 |
}; |
| 15 |
|
| 16 |
int kBaseIndexRegistersUsed; |
| 17 |
|
| 18 |
constexpr array<0> GenMachineInsnInfos() { |
| 19 |
return decltype(MetaValuesHelper<&kBaseIndexRegistersUsed>::MetaValuesFunc(integer_sequence<0>{})){}; |
| 20 |
// expected-error@-1 {{no matching function for call to 'MetaValuesFunc'}} |
| 21 |
} |
| 22 |
|
| 23 |
array<0> u = GenMachineInsnInfos(); |
| 24 |
} // namspace invalid_partial_spec |