aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp23
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-11-30 01:49:21 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2024-11-30 01:49:21 +0100
commitcc67d95dc100706ea665e8cce581d59466aba62e (patch)
tree2b9e8d39d7f513aa182d163c7ec29776820eb0d1 /gcc/testsuite/g++.dg/cpp23
parent20dcb7926bef7546fb1abdf45781d15578756893 (diff)
downloadgcc-cc67d95dc100706ea665e8cce581d59466aba62e.zip
gcc-cc67d95dc100706ea665e8cce581d59466aba62e.tar.gz
gcc-cc67d95dc100706ea665e8cce581d59466aba62e.tar.bz2
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.
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp23')
-rw-r--r--gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C b/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C
index f6a892e..4ff13af 100644
--- a/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C
+++ b/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics3.C
@@ -24,7 +24,7 @@ void S::f12(this S s = {}) {} // { dg-error "an explicit object parameter may no
struct S0 {
template<typename Selves>
- void f(this Selves...) {}
+ void f(this Selves...) {} // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void g(this Selves... selves) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -37,7 +37,7 @@ struct S0 {
void k(this Selves...) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
template<typename Selves>
- void fd(this Selves...);
+ void fd(this Selves...); // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void gd(this Selves... selves); // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -52,7 +52,7 @@ struct S0 {
struct S1 {
template<typename Selves>
- void f(this Selves&...) {}
+ void f(this Selves&...) {} // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void g(this Selves&... selves) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -65,7 +65,7 @@ struct S1 {
void k(this Selves&...) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
template<typename Selves>
- void fd(this Selves&...);
+ void fd(this Selves&...); // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void gd(this Selves&... selves); // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -80,7 +80,7 @@ struct S1 {
struct S2 {
template<typename Selves>
- void f(this Selves&&...) {}
+ void f(this Selves&&...) {} // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void g(this Selves&&... selves) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -93,7 +93,7 @@ struct S2 {
void k(this Selves&&...) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
template<typename Selves>
- void fd(this Selves&&...);
+ void fd(this Selves&&...); // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void gd(this Selves&&... selves); // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -108,7 +108,7 @@ struct S2 {
struct S3 {
template<typename Selves>
- void f(this Selves const&...) {}
+ void f(this Selves const&...) {} // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void g(this Selves const&... selves) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -121,7 +121,7 @@ struct S3 {
void k(this Selves const&...) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
template<typename Selves>
- void fd(this Selves const&...);
+ void fd(this Selves const&...); // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void gd(this Selves const&... selves); // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -136,7 +136,7 @@ struct S3 {
struct S4 {
template<typename Selves>
- void f(this Selves const&&...) {}
+ void f(this Selves const&&...) {} // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void g(this Selves const&&... selves) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
@@ -149,7 +149,7 @@ struct S4 {
void k(this Selves const&&...) {} // { dg-error "an explicit object parameter cannot be a function parameter pack" }
template<typename Selves>
- void fd(this Selves const&&...);
+ void fd(this Selves const&&...); // { dg-warning "omission of ',' before varargs '...' is deprecated" "" { target c++26 } }
template<typename Selves>
void gd(this Selves const&&... selves); // { dg-error "an explicit object parameter cannot be a function parameter pack" }