public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106405] New: GCC incorrectly accepts function template specialization
@ 2022-07-22 9:45 jlame646 at gmail dot com
2022-07-22 9:56 ` [Bug c++/106405] " redi at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: jlame646 at gmail dot com @ 2022-07-22 9:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106405
Bug ID: 106405
Summary: GCC incorrectly accepts function template
specialization
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jlame646 at gmail dot com
Target Milestone: ---
The following program is successfully compiled with gcc even though it is not
valid and so should give a compile time error: https://godbolt.org/z/3xsKKbxE3
template< typename T > int func(); // (1)
template< typename ... Args > int func(); // (2)
template<> int func<int>() { return 1; } //this should give error but gcc
compiles this without any error
int main() {
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/106405] GCC incorrectly accepts function template specialization
2022-07-22 9:45 [Bug c++/106405] New: GCC incorrectly accepts function template specialization jlame646 at gmail dot com
@ 2022-07-22 9:56 ` redi at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2022-07-22 9:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106405
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
MSVC rejects it too, but EDG accepts it in strict mode.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-22 9:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22 9:45 [Bug c++/106405] New: GCC incorrectly accepts function template specialization jlame646 at gmail dot com
2022-07-22 9:56 ` [Bug c++/106405] " redi 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).