Bug 114459 - [C++26] P2893R3 - Variadic friends
Summary: [C++26] P2893R3 - Variadic friends
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks: c++-friends, cxxfriends c++26-core
  Show dependency treegraph
 
Reported: 2024-03-25 11:12 UTC by Jakub Jelinek
Modified: 2024-05-07 20:40 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-03-25 00:00:00


Attachments
gcc14-pr114459.patch (3.01 KB, patch)
2024-05-03 13:11 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2024-03-25 11:12:18 UTC
See <https://wg21.link/P2893R3>.
Comment 1 Drea Pinski 2024-03-25 18:07:28 UTC
.
Comment 2 Jakub Jelinek 2024-05-03 13:11:23 UTC
Created attachment 58100 [details]
gcc14-pr114459.patch

Untested implementation.
Comment 3 GCC Commits 2024-05-07 20:38:45 UTC
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:17458d2bc74b904968e6bdc12527eb040c8d2370

commit r15-304-g17458d2bc74b904968e6bdc12527eb040c8d2370
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue May 7 22:38:01 2024 +0200

    c++: Implement C++26 P2893R3 - Variadic friends [PR114459]
    
    The following patch imeplements the C++26 P2893R3 - Variadic friends
    paper.  The paper allows for the friend type declarations to specify
    more than one friend type specifier and allows to specify ... at
    the end of each.  The patch doesn't introduce tentative parsing of
    friend-type-declaration non-terminal, but rather just extends existing
    parsing where it is a friend declaration which ends with ; after the
    declaration specifiers to the cases where it ends with ...; or , or ...,
    In that case it pedwarns for cxx_dialect < cxx26, handles the ... and
    if there is , continues in a loop to parse the further friend type
    specifiers.
    
    2024-05-07  Jakub Jelinek  <jakub@redhat.com>
    
            PR c++/114459
    gcc/c-family/
            * c-cppbuiltin.cc (c_cpp_builtins): Predefine
            __cpp_variadic_friend=202403L for C++26.
    gcc/cp/
            * parser.cc (cp_parser_member_declaration): Implement C++26
            P2893R3 - Variadic friends.  Parse friend type declarations
            with ... or with more than one friend type specifier.
            * friend.cc (make_friend_class): Allow TYPE_PACK_EXPANSION.
            * pt.cc (instantiate_class_template): Handle PACK_EXPANSION_P
            in friend classes.
    gcc/testsuite/
            * g++.dg/cpp26/feat-cxx26.C (__cpp_variadic_friend): Add test.
            * g++.dg/cpp26/variadic-friend1.C: New test.
Comment 4 Jakub Jelinek 2024-05-07 20:40:32 UTC
Implemented for 15.1.