1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++2a %s
3 template <typename T1
, typename T2
> struct is_same
{
4 static constexpr bool value
= false;
7 template <typename T
> struct is_same
<T
, T
> {
8 static constexpr bool value
= true;
11 template <class T
, class U
>
12 concept SameHelper
= is_same
<T
, U
>::value
;
13 template <class T
, class U
>
14 concept same_as
= SameHelper
<T
, U
> && SameHelper
<U
, T
>;
16 namespace deferred_instantiation
{
17 template <class X
> constexpr X
do_not_instantiate() { return nullptr; }
20 template <same_as
<float> X
> explicit(do_not_instantiate
<X
>()) T(X
) {}
26 // expected-error@17{{cannot initialize}}
27 // expected-note@20{{in instantiation of function template specialization}}
28 // expected-note@30{{while substituting deduced template arguments}}
29 // expected-note@30{{in instantiation of function template specialization}}
31 } // namespace deferred_instantiation