public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102449] New: template parameter with default argument is used without being verified during explicit specialization
@ 2021-09-22 12:15 nickhuang99 at hotmail dot com
  2021-12-16  3:50 ` [Bug c++/102449] " pinskia at gcc dot gnu.org
  2022-01-28 15:51 ` ppalka at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: nickhuang99 at hotmail dot com @ 2021-09-22 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102449
           Summary: template parameter with default argument is used
                    without being verified during explicit specialization
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickhuang99 at hotmail dot com
  Target Milestone: ---

The following snippet code should be rejected because "First" should be checked
with its default argument which is "char"

template<class T,class First=char>
void foo(First,T){}
template<>
void foo<double>(int,double){}

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

* [Bug c++/102449] template parameter with default argument is used without being verified during explicit specialization
  2021-09-22 12:15 [Bug c++/102449] New: template parameter with default argument is used without being verified during explicit specialization nickhuang99 at hotmail dot com
@ 2021-12-16  3:50 ` pinskia at gcc dot gnu.org
  2022-01-28 15:51 ` ppalka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16  3:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this is valid code as the compiler can deduce that First is int.
All compilers I have tried accept the code.

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

* [Bug c++/102449] template parameter with default argument is used without being verified during explicit specialization
  2021-09-22 12:15 [Bug c++/102449] New: template parameter with default argument is used without being verified during explicit specialization nickhuang99 at hotmail dot com
  2021-12-16  3:50 ` [Bug c++/102449] " pinskia at gcc dot gnu.org
@ 2022-01-28 15:51 ` ppalka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-28 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> I think this is valid code as the compiler can deduce that First is int.
> All compilers I have tried accept the code.

Agreed.

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

end of thread, other threads:[~2022-01-28 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 12:15 [Bug c++/102449] New: template parameter with default argument is used without being verified during explicit specialization nickhuang99 at hotmail dot com
2021-12-16  3:50 ` [Bug c++/102449] " pinskia at gcc dot gnu.org
2022-01-28 15:51 ` 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).