public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101883] New: class template argument deduction in non-type template parameter allows explicit deduction guide
@ 2021-08-12 15:29 barry.revzin at gmail dot com
  2021-08-12 18:04 ` [Bug c++/101883] " ppalka at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: barry.revzin at gmail dot com @ 2021-08-12 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101883
           Summary: class template argument deduction in non-type template
                    parameter allows explicit deduction guide
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

Reduced example:

template <class T> struct C { constexpr C(int) {} };
explicit C(int) -> C<int>;

template <C c> struct X { };
X<1> x;

This should fail to compile, because the deduction guide is explicit and so
should not be a candidate, but gcc accepts this example.

gcc does correctly reject:

C y = 1;

Which is the same kind of thing.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-06 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 15:29 [Bug c++/101883] New: class template argument deduction in non-type template parameter allows explicit deduction guide barry.revzin at gmail dot com
2021-08-12 18:04 ` [Bug c++/101883] " ppalka at gcc dot gnu.org
2021-08-18 12:39 ` cvs-commit at gcc dot gnu.org
2021-10-06 14:15 ` cvs-commit at gcc dot gnu.org
2021-10-06 14:16 ` ppalka at gcc dot gnu.org

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