| 1 |
// RUN: %clang_cc1 -std=c++20 -verify -fsyntax-only %s |
| 2 |
|
| 3 |
namespace a { |
| 4 |
template <typename T> |
| 5 |
concept C1 = true; // #C1 |
| 6 |
|
| 7 |
template <typename T> |
| 8 |
auto V1 = true; // #V1 |
| 9 |
|
| 10 |
namespace b { |
| 11 |
template <typename T> |
| 12 |
concept C2 = true; // #C2 |
| 13 |
template <typename T> |
| 14 |
auto V2 = true; // #V2 |
| 15 |
} |
| 16 |
} |
| 17 |
|
| 18 |
template <typename T> |
| 19 |
concept C3 = true; // #C3 |
| 20 |
template <typename T> |
| 21 |
auto V3 = true; // #V3 |
| 22 |
template <template <typename T> typename C> |
| 23 |
constexpr bool test = true; |
| 24 |
|
| 25 |
static_assert(test<a::C1>); // expected-error {{template argument does not refer to a class or alias template, or template template parameter}} \ |
| 26 |
// expected-note@#C1 {{here}} |
| 27 |
static_assert(test<a::b::C2>); // expected-error {{template argument does not refer to a class or alias template, or template template parameter}} \ |
| 28 |
// expected-note@#C2 {{here}} |
| 29 |
static_assert(test<C3>); // expected-error {{template argument does not refer to a class or alias template, or template template parameter}} \ |
| 30 |
// expected-note@#C3 {{here}} |
| 31 |
|
| 32 |
static_assert(test<a::V1>); // expected-error {{template argument does not refer to a class or alias template, or template template parameter}} \ |
| 33 |
// expected-note@#V1 {{here}} |
| 34 |
static_assert(test<a::b::V2>); // expected-error {{template argument does not refer to a class or alias template, or template template parameter}} \ |
| 35 |
// expected-note@#V2 {{here}} |
| 36 |
static_assert(test<V3>); // expected-error {{template argument does not refer to a class or alias template, or template template parameter}} \ |
| 37 |
// expected-note@#V3 {{here}} |
| 38 |
|
| 39 |
|
| 40 |
void f() { |
| 41 |
C3 t1 = 0; // expected-error {{expected 'auto' or 'decltype(auto)' after concept name}} |
| 42 |
a::C1 t2 = 0; // expected-error {{expected 'auto' or 'decltype(auto)' after concept name}} |
| 43 |
a::b::C2 t3 = 0; // expected-error {{expected 'auto' or 'decltype(auto)' after concept name}} |
| 44 |
} |