1 // RUN: %clang_cc1 -std=c++17 -verify %s
4 template <typename T
> class A
{
13 using T
= decltype(a
);
23 template<typename T
> struct D
: B
{ // expected-note {{not viable}} \
24 expected
-note
{{implicit deduction guide declared as
'template <typename T> D(D<T>) -> D<T>'}}
25 D(T
, typename
T::type
); // expected-note {{private member}} \
26 // expected-note {{implicit deduction guide declared as 'template <typename T> D(T, typename T::type) -> D<T>'}}
33 D x
= {X(), {}}; // expected-error {{no viable constructor or deduction guide}}
35 // Once we implement proper support for dependent nested name specifiers in
36 // friends, this should still work.
38 template <typename T
> friend D
<T
>::D(T
, typename
T::type
); // expected-warning {{dependent nested name specifier}}
44 template <typename T
> friend class D
;
51 template<class> struct X
{};
52 template<class = void> struct X
;
55 template<class T
, class B
> struct Y
{ Y(T
); };
56 template<class T
, class B
=void> struct Y
;
60 namespace NoCrashOnGettingDefaultArgLoc
{
63 A(int = 1); // expected-note {{candidate template ignored: couldn't infer template argumen}} \
64 // expected-note {{implicit deduction guide declared as 'template <typename> D(int = <null expr>) -> D<type-parameter-0-0>'}}
70 class D
: C
{ // expected-note {{candidate function template not viable: requires 1 argument}} \
71 expected
-note
{{implicit deduction guide declared as
'template <typename> D(D<type-parameter-0-0>) -> D<type-parameter-0-0>'}}
74 D abc
; // expected-error {{no viable constructor or deduction guide}}