public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "raul at tambre dot ee" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/95287] New: Incorrect default argument checking for specializations of functions with parameter packs
Date: Sat, 23 May 2020 12:34:30 +0000	[thread overview]
Message-ID: <bug-95287-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2020-05-23 12:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 12:34 raul at tambre dot ee [this message]
2020-05-23 12:36 ` [Bug c++/95287] " raul at tambre dot ee

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-95287-4@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).