1 // RUN: %clang_cc1 -std=c++2a -verify %s
3 // When forming and checking satisfaction of atomic constraints, we will
4 // substitute still-dependent template arguments into an expression, and later
5 // substitute into the result. This creates some unique situations; check that
8 namespace SubstIntoResolvedTypeTemplateArg
{
9 template<int, class> struct X
{};
11 template<class T
> concept A
= true;
12 template<class T
> concept B
= sizeof(T
) != 0;
13 template<class T
> concept C
= B
<X
<1, T
>>;
15 int f(A
auto); // expected-note {{candidate}}
16 int f(C
auto); // expected-note {{candidate}}
17 int k1
= f(0); // expected-error {{ambiguous}}
19 template<class T
> concept D
= A
<T
> && B
<X
<1, T
>>;
23 // The atomic constraint formed from B<X<(int)'\1', T>> is identical to the
24 // one formed from C, even though the template arguments are written as
25 // different expressions; the "equivalent" rules are used rather than the
26 // "identical" rules when matching template arguments in concept-ids.
27 template<class T
> concept E
= A
<T
> && B
<X
<(int)'\1', T
>>;
29 int g(E
auto); // expected-note {{candidate}}
32 int g(D
auto); // expected-note {{candidate}}
33 int k4
= g(0); // expected-error {{ambiguous}}