Bug 117786 - [C++26] P3176R0 - Oxford variadic comma
Summary: [C++26] P3176R0 - Oxford variadic comma
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 15.0
: P3 normal
Target Milestone: 15.0
Assignee: Jakub Jelinek
URL: https://gcc.gnu.org/pipermail/gcc-pat...
Keywords:
Depends on:
Blocks: c++26-core
  Show dependency treegraph
 
Reported: 2024-11-26 09:32 UTC by Jakub Jelinek
Modified: 2024-11-30 00:55 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-11-26 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2024-11-26 09:32:23 UTC
See <https://wg21.link/P3176R0>.
Comment 2 Jakub Jelinek 2024-11-30 00:55:07 UTC
https://gcc.gnu.org/g:cc67d95dc100706ea665e8cce581d59466aba62e

commit r15-5813-gcc67d95dc100706ea665e8cce581d59466aba62e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Nov 30 01:49:21 2024 +0100

    c++: Implement C++26 P3176R1 - The Oxford variadic comma
    
    While we are already in stage3, I wonder if implementing this small paper
    wouldn't be useful even for GCC 15, so that we have in the GCC world one
    extra year of deprecation of variadic ellipsis without preceding comma.
    
    The paper just deprecates something, I'd hope most of the C++ code in the
    wild when it uses variadic functions at all uses the comma before the
    ellipsis.
    
    2024-11-30  Jakub Jelinek  <jakub@redhat.com>
    
    gcc/c-family/
            * c.opt (Wdeprecated-variadic-comma-omission): New option.
            * c.opt.urls: Regenerate.
            * c-opts.cc (c_common_post_options): Default to
            -Wdeprecated-variadic-comma-omission for C++26 or -Wpedantic.
    gcc/cp/
            * parser.cc: Implement C++26 P3176R1 - The Oxford variadic comma.
            (cp_parser_parameter_declaration_clause): Emit
            -Wdeprecated-variadic-comma-omission warnings.
    gcc/
            * doc/invoke.texi (-Wdeprecated-variadic-comma-omission): Document.
    gcc/testsuite/
            * g++.dg/cpp26/variadic-comma1.C: New test.
            * g++.dg/cpp26/variadic-comma2.C: New test.
            * g++.dg/cpp26/variadic-comma3.C: New test.
            * g++.dg/cpp26/variadic-comma4.C: New test.
            * g++.dg/cpp26/variadic-comma5.C: New test.
            * g++.dg/cpp1z/fold10.C: Expect a warning for C++26.
            * g++.dg/ext/attrib33.C: Likewise.
            * g++.dg/cpp1y/lambda-generic-variadic19.C: Likewise.
            * g++.dg/cpp2a/lambda-generic10.C: Likewise.
            * g++.dg/cpp0x/lambda/lambda-const3.C: Likewise.
            * g++.dg/cpp0x/variadic164.C: Likewise.
            * g++.dg/cpp0x/variadic17.C: Likewise.
            * g++.dg/cpp0x/udlit-args-neg.C: Likewise.
            * g++.dg/cpp0x/variadic28.C: Likewise.
            * g++.dg/cpp0x/gen-attrs-33.C: Likewise.
            * g++.dg/cpp23/explicit-obj-diagnostics3.C: Likewise.
            * g++.old-deja/g++.law/operators15.C: Likewise.
            * g++.old-deja/g++.mike/p811.C: Likewise.
            * g++.old-deja/g++.mike/p12306.C (printf): Add , before ... .
            * g++.dg/analyzer/fd-bind-pr107783.C (bind): Likewise.
            * g++.dg/cpp0x/vt-65790.C (printf): Likewise.
    libstdc++-v3/
            * include/std/functional (_Bind_check_arity): Add , before ... .
            * include/bits/refwrap.h (_Mem_fn_traits, _Weak_result_type_impl):
            Likewise.
            * include/tr1/type_traits (is_function): Likewise.