public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "s.murthy at outlook dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
Date: Thu, 27 Jun 2024 03:22:59 +0000	[thread overview]
Message-ID: <bug-115672-4-csRT8AEHbZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115672-4@http.gcc.gnu.org/bugzilla/>

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. 🙏

  parent reply	other threads:[~2024-06-27  3:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27  0:31 [Bug c++/115672] New: " s.murthy at outlook dot com
2024-06-27  0:33 ` [Bug c++/115672] " s.murthy at outlook dot com
2024-06-27  0:34 ` s.murthy at outlook dot com
2024-06-27  1:37 ` pinskia at gcc dot gnu.org
2024-06-27  1:45 ` [Bug c++/115672] [11/12/13/14/15 Regression] " pinskia at gcc dot gnu.org
2024-06-27  1:52 ` pinskia at gcc dot gnu.org
2024-06-27  1:52 ` pinskia at gcc dot gnu.org
2024-06-27  3:22 ` s.murthy at outlook dot com [this message]
2024-06-28  0:19 ` s.murthy at outlook dot com
2024-06-28  0:24 ` s.murthy at outlook dot com
2024-06-28  0:27 ` s.murthy at outlook dot com
2024-06-28  0:32 ` s.murthy at outlook dot com
2024-06-28  0:34 ` s.murthy at outlook dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-115672-4-csRT8AEHbZ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).