@@ -207,13 +207,14 @@ namespace test15 {
207207template <class T > struct Foo { Foo(T); };
208208
209209template <class V > using AFoo = Foo<V *>;
210- template <typename > concept False = false ;
210+ template <typename > concept False = false ; // #test15_False
211211template <False W>
212- using BFoo = AFoo<W>; // expected-note {{candidate template ignored: constraints not satisfied [with V = int]}} \
213- // expected-note {{cannot deduce template arguments for 'BFoo' from 'Foo<int *>'}} \
214- // expected-note {{implicit deduction guide declared as 'template <class V> requires __is_deducible(AFoo, Foo<V *>) && __is_deducible(test15::BFoo, Foo<V *>) BFoo(V *) -> Foo<V *>}} \
215- // expected-note {{candidate template ignored: could not match 'Foo<V *>' against 'int *'}} \
216- // expected-note {{template <class V> requires __is_deducible(AFoo, Foo<V *>) && __is_deducible(test15::BFoo, Foo<V *>) BFoo(Foo<V *>) -> Foo<V *>}}
212+ using BFoo = AFoo<W>; // expected-note {{candidate template ignored: constraints not satisfied [with W = int]}} \
213+ // expected-note@-1 {{because 'int' does not satisfy 'False'}} \
214+ // expected-note@#test15_False {{because 'false' evaluated to false}} \
215+ // expected-note {{implicit deduction guide declared as 'template <False<> W> requires __is_deducible(AFoo, Foo<W *>) && __is_deducible(test15::BFoo, Foo<W *>) BFoo(W *) -> Foo<W *>}} \
216+ // expected-note {{candidate template ignored: could not match 'Foo<W *>' against 'int *'}} \
217+ // expected-note {{template <False<> W> requires __is_deducible(AFoo, Foo<W *>) && __is_deducible(test15::BFoo, Foo<W *>) BFoo(Foo<W *>) -> Foo<W *>}}
217218int i = 0 ;
218219AFoo a1 (&i); // OK, deduce Foo<int *>
219220
@@ -441,6 +442,32 @@ ACase4 case4{0, 1};
441442
442443} // namespace test24
443444
445+ namespace test25 {
446+
447+ template <typename T, typename ...Us>
448+ struct A {
449+ template <typename V> requires __is_same (V, int )
450+ A(V);
451+ };
452+
453+ template <typename ...TS>
454+ using AA = A<int , TS...>;
455+
456+ template <typename ...US>
457+ using BB = AA<US...>; // #test25_BB
458+
459+ BB a{0 };
460+ static_assert (__is_same(decltype (a), A<int >));
461+ // FIXME: The template parameter list of generated deduction guide is not strictly conforming,
462+ // as the pack occurs prior to the non-packs.
463+ BB b{0 , 1 };
464+ // expected-error@-1 {{no viable}}
465+ // expected-note@#test25_BB 2{{not viable}}
466+ // expected-note@#test25_BB {{template <typename ...US, typename V> requires __is_same(V, int) && __is_deducible(AA, A<int, US...>) && __is_deducible(test25::BB, A<int, US...>) BB(V) -> A<int, US...>}}
467+ // expected-note@#test25_BB {{implicit deduction guide}}
468+
469+ }
470+
444471namespace GH92212 {
445472template <typename T, typename ...Us>
446473struct A {
@@ -526,6 +553,7 @@ void foo() { test<{1, 2, 3}>(); }
526553
527554} // namespace GH113518
528555
556+ // FIXME: This is accepted by GCC: https://gcc.godbolt.org/z/f3rMfbacz
529557namespace GH125821 {
530558template <typename T>
531559struct A { A(T){} };
@@ -539,3 +567,22 @@ using C = Proxy< A<T> >;
539567C test{ 42 }; // expected-error {{no viable constructor or deduction guide for deduction of template arguments}}
540568
541569} // namespace GH125821
570+
571+ namespace GH133132 {
572+
573+ template <class T >
574+ struct A {};
575+
576+ template <class T >
577+ using Foo = A<A<T>>;
578+
579+ template <class T >
580+ using Bar = Foo<T>;
581+
582+ template <class T = int >
583+ using Baz = Bar<T>;
584+
585+ Baz a{};
586+ static_assert (__is_same(decltype (a), A<A<int >>));
587+
588+ } // namespace GH133132
0 commit comments