public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95287] New: Incorrect default argument checking for specializations of functions with parameter packs
@ 2020-05-23 12:34 raul at tambre dot ee
2020-05-23 12:36 ` [Bug c++/95287] " raul at tambre dot ee
0 siblings, 1 reply; 2+ messages in thread
From: raul at tambre dot ee @ 2020-05-23 12:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95287
Bug ID: 95287
Summary: Incorrect default argument checking for
specializations of functions with parameter packs
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: raul at tambre dot ee
Target Milestone: ---
template<class... Ts>
void j(int i = 0, Ts... ts) {}
template<>
void j<int>(int i, int j) {}
Fails to compile with:
<source>:5:24: error: default argument missing for parameter 2 of 'void j(int,
Ts ...) [with Ts = {int}]'
5 | void j<int>(int i, int j) {}
| ~~~~^
<source>:5:17: note: ...following parameter 1 which has a default argument
5 | void j<int>(int i, int j) {}
| ~~~~^
This is valid code.
Possibly related to DR2233[0], which supersedes DR777[1].
MSVC and ICC accept this code.
Clang has a patch in review to implement DR2233[2].
[0] http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2233
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#777
[2] https://reviews.llvm.org/D79800
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/95287] Incorrect default argument checking for specializations of functions with parameter packs
2020-05-23 12:34 [Bug c++/95287] New: Incorrect default argument checking for specializations of functions with parameter packs raul at tambre dot ee
@ 2020-05-23 12:36 ` raul at tambre dot ee
0 siblings, 0 replies; 2+ messages in thread
From: raul at tambre dot ee @ 2020-05-23 12:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95287
--- Comment #1 from Raul Tambre <raul at tambre dot ee> ---
Possibly of interest:
https://godbolt.org/z/NQus4z
Shows the implementation divergence with regard to DR777 and DR2233.
Only MSVC currently handles all cases correctly.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-23 12:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 12:34 [Bug c++/95287] New: Incorrect default argument checking for specializations of functions with parameter packs raul at tambre dot ee
2020-05-23 12:36 ` [Bug c++/95287] " raul at tambre dot ee
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).