public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/113307] New: fails to diagnose an explicit object parameter to be a function parameter pack
@ 2024-01-10 11:36 cooky.ykooc922 at gmail dot com
  2024-01-10 21:03 ` [Bug c++/113307] " waffl3x at protonmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cooky.ykooc922 at gmail dot com @ 2024-01-10 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113307
           Summary: fails to diagnose an explicit object parameter to be a
                    function parameter pack
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cooky.ykooc922 at gmail dot com
  Target Milestone: ---

With the recent support of explicit parameter object functions, the compiler
fails to diagnose the aforementioned function to be a function parameter pack. 

struct A {
    void f(this A);

    // bug: no error
    // correct behavior: must be error
    template <typename... Args>
    void g(this Args&&...);

    template <typename... Args>
    void h(this A, Args&&...);
};

Clang and MSVC seem to reject the code snippet above which is valid according
to the standard https://eel.is/c++draft/dcl.fct:

"An explicit object parameter shall not be a function parameter pack
([temp.variadic])."

godbolt link: 

https://godbolt.org/z/Es6Mzba59

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

* [Bug c++/113307] fails to diagnose an explicit object parameter to be a function parameter pack
  2024-01-10 11:36 [Bug c++/113307] New: fails to diagnose an explicit object parameter to be a function parameter pack cooky.ykooc922 at gmail dot com
@ 2024-01-10 21:03 ` waffl3x at protonmail dot com
  2024-01-16 21:11 ` cvs-commit at gcc dot gnu.org
  2024-01-16 21:24 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: waffl3x at protonmail dot com @ 2024-01-10 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from waffl3x <waffl3x at protonmail dot com> ---
I'm on it.

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

* [Bug c++/113307] fails to diagnose an explicit object parameter to be a function parameter pack
  2024-01-10 11:36 [Bug c++/113307] New: fails to diagnose an explicit object parameter to be a function parameter pack cooky.ykooc922 at gmail dot com
  2024-01-10 21:03 ` [Bug c++/113307] " waffl3x at protonmail dot com
@ 2024-01-16 21:11 ` cvs-commit at gcc dot gnu.org
  2024-01-16 21:24 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-16 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:6aae831a3fe6619794afa79410e6fc1b4817f0b1

commit r14-8163-g6aae831a3fe6619794afa79410e6fc1b4817f0b1
Author: waffl3x <waffl3x@protonmail.com>
Date:   Fri Jan 12 07:40:19 2024 +0000

    c++: reject packs on xobj params [PR113307]

    Reject and diagnose xobj parameters declared as parameter packs.

            PR c++/113307

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_parameter_declaration): Reject packs
            on xobj params.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp23/explicit-obj-diagnostics3.C: Add test for
            rejection of packs.

    Signed-off-by: Waffl3x <waffl3x@protonmail.com>

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

* [Bug c++/113307] fails to diagnose an explicit object parameter to be a function parameter pack
  2024-01-10 11:36 [Bug c++/113307] New: fails to diagnose an explicit object parameter to be a function parameter pack cooky.ykooc922 at gmail dot com
  2024-01-10 21:03 ` [Bug c++/113307] " waffl3x at protonmail dot com
  2024-01-16 21:11 ` cvs-commit at gcc dot gnu.org
@ 2024-01-16 21:24 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2024-01-16 21:24 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-01-16 21:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10 11:36 [Bug c++/113307] New: fails to diagnose an explicit object parameter to be a function parameter pack cooky.ykooc922 at gmail dot com
2024-01-10 21:03 ` [Bug c++/113307] " waffl3x at protonmail dot com
2024-01-16 21:11 ` cvs-commit at gcc dot gnu.org
2024-01-16 21:24 ` jason 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).