1 // RUN: %clang_cc1 -std=c++17 -verify %s
3 template<typename T
> struct A
{
4 template<typename U
> struct B
{
6 B(const B
&) = default;
8 template<typename U
> B(U
) -> B
<U
>;
13 using T
= decltype(b
);
14 using T
= A
<void>::B
<int>;
16 using Copy
= decltype(copy
);
17 using Copy
= A
<void>::B
<int>;
21 template <class, class> struct S
{};
42 template <class U
, class... T
> struct Unrelated
{
43 using Trouble
= S
<U
, T
...>;
45 template <class... V
> using Trouble2
= S
<V
..., T
...>;
48 template <class T
, class U
> struct Outer
{
49 using Trouble
= S
<U
, T
>;
51 template <class V
> using Trouble2
= S
<V
, T
>;
53 template <class V
> using Trouble3
= S
<U
, T
>;
55 template <class V
> struct Inner
{
56 template <class W
> struct Paranoid
{
57 using Trouble4
= S
<W
, T
>;
59 template <class... X
> using Trouble5
= S
<X
..., T
>;
62 Inner(trouble_1
, V v
, Trouble trouble
) {}
63 Inner(trouble_2
, V v
, Trouble2
<V
> trouble
) {}
64 Inner(trouble_3
, V v
, Trouble3
<V
> trouble
) {}
65 Inner(trouble_4
, V v
, typename Unrelated
<U
, T
>::template Trouble2
<V
> trouble
) {}
66 Inner(trouble_5
, V v
, typename Unrelated
<U
, T
>::Trouble trouble
) {}
67 Inner(trouble_6
, V v
, typename Unrelated
<V
, T
>::Trouble trouble
) {}
68 Inner(trouble_7
, V v
, typename Paranoid
<V
>::Trouble4 trouble
) {}
69 Inner(trouble_8
, V v
, typename Paranoid
<V
>::template Trouble5
<V
> trouble
) {}
71 Inner(trouble_9
, V v
, W w
, typename Paranoid
<V
>::template Trouble5
<W
> trouble
) {}
77 Outer
<char, int>::Inner
_1(t1
, 42, s
);
78 Outer
<char, int>::Inner
_2(t2
, 42, s
);
79 Outer
<char, int>::Inner
_3(t3
, 42, s
);
80 Outer
<char, int>::Inner
_4(t4
, 42, s
);
81 Outer
<char, int>::Inner
_5(t5
, 42, s
);
82 Outer
<char, int>::Inner
_6(t6
, 42, s
);
83 Outer
<char, int>::Inner
_7(t7
, 42, s
);
84 Outer
<char, int>::Inner
_8(t8
, 42, s
);
85 Outer
<char, int>::Inner
_9(t9
, 42, 24, s
);
87 // Make sure we don't accidentally inject the TypedefNameDecl into the TU.
88 Trouble should_not_be_in_the_tu_decl
; // expected-error {{unknown type name 'Trouble'}}
90 } // namespace GH94614