1 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
4 template <typename T
, typename U
= void*> struct B
{ // expected-note 14{{candidate}}
5 B() // expected-note 7{{not viable}}
6 requires
__is_same(T
, int); // expected-note 7{{because '__is_same(char, int)' evaluated to false}}
9 template <typename U
> struct B
<void, U
> : B
<int, U
> {
14 void g(B
<T
>); // expected-note {{cannot convert}}
39 B
<char> b1
; // expected-error {{no matching constructor}}
40 B
<char> b2
{}; // expected-error {{no matching constructor}}
41 B
<char> b3
= {}; // expected-error {{no matching constructor}}
42 new B
<char>{}; // expected-error {{no matching constructor}}
43 new B
<char>(); // expected-error {{no matching constructor}}
44 g
<char>({}); // expected-error {{no matching function}}
45 B
<char>{}; // expected-error {{no matching constructor}}
46 B
<char>(); // expected-error {{no matching constructor}}
50 namespace no_early_substitution
{
51 template <typename T
> concept X
= true;
55 template <typename T
> struct B
{
60 template <typename U
= int, typename V
= A
>
61 struct C
: public B
<V
&> {
66 // OK, we only substitute T ~> V& into X<T*> in a SFINAE context,
67 // during satisfaction checks.
75 template <typename T
> struct Test
{
79 struct Bar
: public Test
<int> {
80 using Test
<int>::Test
;
83 struct Test
<void> : public Test
<int> {
84 using Test
<int>::Test
;