https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672

--- Comment #6 from Sean Murthy <s.murthy at outlook dot com> ---
(In reply to Andrew Pinski from comment #4)
> Created attachment 58528 [details]
> Reduced further
> 
> The second t argument type in the template definition is the key I think.
> Changing it to just class allows the testcase to work.

Yes, both observations I made in my follow up to 115656 apply here as well:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115656#c6

Those two observations give me the inkling the template template parameter and
the template it references both being constrained is likely causing the issue:
each of the observations call for only of those two to be constrained which
causes the compiler to produce the expected output.

Not surprisingly, the third point I made in that 115656 follow up also applies
here: in the initial repro, use type_traits to constrain the class template dv,
and that causes CTAD fail on the deducing ctor, regardless of if/how the
template template parameter is constrained. This behavior suggests to me an
issue with traits-concepts interplay/substitutability. And this behavior goes
all the way back to GCC 10.1, making that particular aspect not a regression
issue (unless something traits-specific pre-C++20 issue exists).

A a1(45ul); //ctad fail if dv template constrained using traits

See: https://sigcpp.godbolt.org/z/GqaPhG17W

BTW thanks to all the GCC devs and maintainers for the awesome product and
follow up. And please forgive me when I use incorrect C++ terminology. I'm just
a 3/10 C++ programmer fumbling my way around. 🙏

Reply via email to