On Tue, Nov 25, 2025 at 11:36:49PM +0530, Jason Merrill wrote: > It seems discussion has died down, so I think let's go ahead with this, with > an additional note in the standards.texi C++20 section that -std=c++20 > doesn't yet enable modules.
So like this (incremental change first, full patch attached)? The libcody part isn't needed after the tweaks acked by Nathan. -2025-11-15 Jakub Jelinek <[email protected]> +2025-11-25 Jakub Jelinek <[email protected]> gcc/ * doc/invoke.texi (gnu++17): Remove comment about the default. - (c++20): Remove note about experimental support. + (c++20): Remove note about experimental support, except add a note + that modules are still experimental and need to be enabled separately. (gnu++20): Likewise. Move here comment about the default. + (fcoroutines): Mention it is enabled by default for C++20 and later. * doc/standards.texi: Document that the default for C++ is -std=gnu++20. gcc/c-family/ @@ -49,13 +51,10 @@ libgomp/ instead of v++;. * testsuite/libgomp.c-c++-common/depend-iterator-2.c: Use v = v + 1; instead of v++. -libcody/ - * Makefile.in (CXXOPTS): Append $(filter -std=%,@CXX@) to make - sure it is compiled with -std=c++11 rather than -std=gnu++20. --- gcc/doc/invoke.texi 2025-11-15 12:05:07.040849058 +0100 +++ gcc/doc/invoke.texi 2025-11-25 19:40:52.096747038 +0100 @@ -2632,12 +2632,16 @@ @item c++20 @itemx c++2a The 2020 ISO C++ standard plus amendments. +C++20 modules support is still experimental and needs to be +enabled with @code{-fmodules} option. The name @samp{c++2a} is deprecated. @item gnu++20 @itemx gnu++2a GNU dialect of @option{-std=c++20}. This is the default for C++ code. +C++20 modules support is still experimental and needs to be +enabled with @code{-fmodules} option. The name @samp{gnu++2a} is deprecated. @item c++23 @@ -3394,7 +3398,9 @@ @opindex fcoroutines @item -fcoroutines -Enable support for the C++ coroutines extension (experimental). +Enable support for the C++ coroutines extension. With @option{-std=c++20} +and above, coroutines are part of the language standard, so +@option{-fcoroutines} defaults to on. @opindex fdiagnostics-all-candidates @item -fdiagnostics-all-candidates reverted: --- libcody/Makefile.in 2025-11-15 17:13:48.640759404 +0100 +++ libcody/Makefile.in.jj 2023-06-16 12:01:15.028683773 +0200 @@ -21,7 +21,7 @@ # C++ compiler options CXXFLAGS := @CXXFLAGS@ CXXINC := $(filter -I%,@CXX@) +CXXOPTS := $(CXXFLAGS) @PICFLAG@ -CXXOPTS := $(CXXFLAGS) @PICFLAG@ $(filter -std=%,@CXX@) ifneq (@EXCEPTIONS@,yes) CXXOPTS += -fno-exceptions -fno-rtti Jakub
2025-11-25 Jakub Jelinek <[email protected]> gcc/ * doc/invoke.texi (gnu++17): Remove comment about the default. (c++20): Remove note about experimental support, except add a note that modules are still experimental and need to be enabled separately. (gnu++20): Likewise. Move here comment about the default. (fcoroutines): Mention it is enabled by default for C++20 and later. * doc/standards.texi: Document that the default for C++ is -std=gnu++20. gcc/c-family/ * c-opts.cc (c_common_init_options): Call set_std_cxx20 rather than set_std_cxx17. * c.opt (std=c++2a): Change description to deprecated option wording. (std=c++20): Remove experimental support part. (std=c++2b): Change description to deprecated option wording. (std=gnu++2a): Likewise. (std=gnu++20): Remove experimental support part. (std=gnu++2b): Change description to deprecated option wording. gcc/testsuite/ * lib/target-supports.exp: Set cxx_default to c++20 rather than c++17. * lib/g++-dg.exp (g++-std-flags): Reorder list to put 20 first and 17 after 26. * g++.dg/debug/pr80461.C (bar): Use v = v + 1; instead of ++v;. * g++.dg/debug/pr94459.C: Add -std=gnu++17 to dg-options. * g++.dg/diagnostic/virtual-constexpr.C: Remove dg-skip-if, instead use { c++11 && c++17_down } effective target instead of c++11. * g++.dg/guality/pr67192.C: Add -std=gnu++17. * g++.dg/torture/pr84961-1.C: Likewise. * g++.dg/torture/pr84961-2.C: Likewise. * g++.dg/torture/pr51482.C (anim_track_bez_wvect::tangent): Cast key_class to int before multiplying it by float. * g++.dg/tree-prof/partition1.C (bar): Use l = l + 1; return l; instead of return ++l;. * obj-c++.dg/exceptions-3.mm: Add -std=gnu++17. * obj-c++.dg/exceptions-5.mm: Likewise. libgomp/ * testsuite/libgomp.c++/atomic-12.C (main): Add ()s around array reference index. * testsuite/libgomp.c++/atomic-13.C: Likewise. * testsuite/libgomp.c++/atomic-8.C: Likewise. * testsuite/libgomp.c++/atomic-9.C: Likewise. * testsuite/libgomp.c++/loop-6.C: Use count = count + 1; return count > 0; instead of return ++count > 0;. * testsuite/libgomp.c++/pr38650.C: Add -std=gnu++17. * testsuite/libgomp.c++/target-lambda-1.C (merge_data_func): Use [=,this] instead of just [=] in lambda captures. * testsuite/libgomp.c-c++-common/target-40.c (f1): Use v += 1; instead of v++;. * testsuite/libgomp.c-c++-common/depend-iterator-2.c: Use v = v + 1; instead of v++. --- gcc/doc/invoke.texi.jj 2025-11-25 19:29:48.969354490 +0100 +++ gcc/doc/invoke.texi 2025-11-25 19:40:52.096747038 +0100 @@ -2627,21 +2627,21 @@ The name @samp{c++1z} is deprecated. @item gnu++17 @itemx gnu++1z GNU dialect of @option{-std=c++17}. -This is the default for C++ code. The name @samp{gnu++1z} is deprecated. @item c++20 @itemx c++2a The 2020 ISO C++ standard plus amendments. -Support is experimental, and could change in incompatible ways in -future releases. +C++20 modules support is still experimental and needs to be +enabled with @code{-fmodules} option. The name @samp{c++2a} is deprecated. @item gnu++20 @itemx gnu++2a GNU dialect of @option{-std=c++20}. -Support is experimental, and could change in incompatible ways in -future releases. +This is the default for C++ code. +C++20 modules support is still experimental and needs to be +enabled with @code{-fmodules} option. The name @samp{gnu++2a} is deprecated. @item c++23 @@ -3398,7 +3398,9 @@ called. If the handler returns, executi @opindex fcoroutines @item -fcoroutines -Enable support for the C++ coroutines extension (experimental). +Enable support for the C++ coroutines extension. With @option{-std=c++20} +and above, coroutines are part of the language standard, so +@option{-fcoroutines} defaults to on. @opindex fdiagnostics-all-candidates @item -fdiagnostics-all-candidates --- gcc/doc/standards.texi.jj 2025-11-15 16:03:45.592512303 +0100 +++ gcc/doc/standards.texi 2025-11-25 19:31:33.016932155 +0100 @@ -289,7 +289,7 @@ select an extended version of the C++ la @option{-std=gnu++23} (for C++23 with GNU extensions). The default, if -no C++ language dialect options are given, is @option{-std=gnu++17}. +no C++ language dialect options are given, is @option{-std=gnu++20}. @section Objective-C and Objective-C++ Languages @cindex Objective-C --- gcc/c-family/c-opts.cc.jj 2025-11-25 10:03:24.969915392 +0100 +++ gcc/c-family/c-opts.cc 2025-11-25 19:31:33.017145007 +0100 @@ -274,9 +274,9 @@ c_common_init_options (unsigned int deco } } - /* Set C++ standard to C++17 if not specified on the command line. */ + /* Set C++ standard to C++20 if not specified on the command line. */ if (c_dialect_cxx ()) - set_std_cxx17 (/*ISO*/false); + set_std_cxx20 (/*ISO*/false); global_dc->get_source_printing_options ().colorize_source_p = true; } --- gcc/c-family/c.opt.jj 2025-11-25 19:29:48.877356101 +0100 +++ gcc/c-family/c.opt 2025-11-25 19:31:33.017406274 +0100 @@ -2618,15 +2618,15 @@ Conform to the ISO 2017 C++ standard. std=c++2a C++ ObjC++ Alias(std=c++20) Undocumented -Conform to the ISO 2020 C++ standard (experimental and incomplete support). +Deprecated in favor of -std=c++20. std=c++20 C++ ObjC++ -Conform to the ISO 2020 C++ standard (experimental and incomplete support). +Conform to the ISO 2020 C++ standard. std=c++2b C++ ObjC++ Alias(std=c++23) Undocumented -Conform to the ISO 2023 C++ standard (published in 2024; experimental and incomplete support). +Deprecated in favor of -std=c++23. std=c++23 C++ ObjC++ @@ -2720,15 +2720,15 @@ Conform to the ISO 2017 C++ standard wit std=gnu++2a C++ ObjC++ Alias(std=gnu++20) Undocumented -Conform to the ISO 2020 C++ standard with GNU extensions (experimental and incomplete support). +Deprecated in favor of -std=gnu++20. std=gnu++20 C++ ObjC++ -Conform to the ISO 2020 C++ standard with GNU extensions (experimental and incomplete support). +Conform to the ISO 2020 C++ standard with GNU extensions. std=gnu++2b C++ ObjC++ Alias(std=gnu++23) Undocumented -Conform to the ISO 2023 C++ standard with GNU extensions (published in 2024; experimental and incomplete support). +Deprecated in favor of -std=gnu++23. std=gnu++23 C++ ObjC++ --- gcc/testsuite/lib/target-supports.exp.jj 2025-11-25 10:03:25.581904700 +0100 +++ gcc/testsuite/lib/target-supports.exp 2025-11-25 19:31:33.018203835 +0100 @@ -12158,7 +12158,7 @@ proc check_effective_target_c++ { } { return 0 } -set cxx_default "c++17" +set cxx_default "c++20" # Check whether the current active language standard supports the features # of C++11/C++14 by checking for the presence of one of the -std flags. # This assumes that the default for the compiler is $cxx_default, and that --- gcc/testsuite/lib/g++-dg.exp.jj 2025-11-15 16:03:45.593512289 +0100 +++ gcc/testsuite/lib/g++-dg.exp 2025-11-25 19:31:33.018896225 +0100 @@ -78,7 +78,7 @@ proc g++-std-flags { test } { # The order of this list is significant: first $cxx_default, # then the oldest and newest, then others in rough order of # importance based on test coverage and usage. - foreach ver { 17 98 26 11 20 14 23 } { + foreach ver { 20 98 26 17 11 14 23 } { set cmpver $ver if { $ver == 98 } { set cmpver 03 } if { [llength $std_list] < 3 --- gcc/testsuite/g++.dg/debug/pr80461.C.jj 2025-11-17 09:39:18.738767113 +0100 +++ gcc/testsuite/g++.dg/debug/pr80461.C 2025-11-25 19:31:33.040532141 +0100 @@ -30,7 +30,7 @@ bar () { O q; A<P> f = q; - v++; + v = v + 1; } void --- gcc/testsuite/g++.dg/debug/pr94459.C.jj 2025-11-17 09:39:18.738767113 +0100 +++ gcc/testsuite/g++.dg/debug/pr94459.C 2025-11-25 19:31:33.041063752 +0100 @@ -1,6 +1,6 @@ // PR debug/94459 // { dg-do compile { target c++14 } } -// { dg-options "-g -dA" } +// { dg-options "-g -dA -std=gnu++17" } template <typename T> struct S --- gcc/testsuite/g++.dg/diagnostic/virtual-constexpr.C.jj 2025-11-17 09:39:18.976763767 +0100 +++ gcc/testsuite/g++.dg/diagnostic/virtual-constexpr.C 2025-11-25 19:31:33.041532123 +0100 @@ -1,6 +1,5 @@ // { dg-options "-fdiagnostics-show-caret -pedantic-errors" } -// { dg-do compile { target c++11 } } -// { dg-skip-if "virtual constexpr" { *-*-* } { "-std=gnu++2a" } { "" } } +// { dg-do compile { target { c++11 && c++17_down } } } struct S { --- gcc/testsuite/g++.dg/guality/pr67192.C.jj 2025-11-17 09:39:18.976763767 +0100 +++ gcc/testsuite/g++.dg/guality/pr67192.C 2025-11-25 19:31:33.042321107 +0100 @@ -1,6 +1,6 @@ /* PR debug/67192 */ /* { dg-do run } */ -/* { dg-options "-x c++ -g -Wmisleading-indentation" } */ +/* { dg-options "-x c++ -g -Wmisleading-indentation -std=gnu++17" } */ volatile int cnt = 0; --- gcc/testsuite/g++.dg/torture/pr84961-2.C.jj 2025-11-17 09:39:19.248759943 +0100 +++ gcc/testsuite/g++.dg/torture/pr84961-2.C 2025-11-25 19:31:33.042541040 +0100 @@ -1,5 +1,6 @@ // PR c++/84961 // { dg-do compile } +// { dg-options "-std=gnu++17" } short a; volatile int b; --- gcc/testsuite/g++.dg/torture/pr84961-1.C.jj 2025-11-17 09:39:19.248759943 +0100 +++ gcc/testsuite/g++.dg/torture/pr84961-1.C 2025-11-25 19:31:33.042789700 +0100 @@ -1,5 +1,6 @@ // PR c++/84961 // { dg-do compile } +// { dg-options "-std=gnu++17" } short a; volatile int b; --- gcc/testsuite/g++.dg/torture/pr51482.C.jj 2025-11-17 09:39:19.248759943 +0100 +++ gcc/testsuite/g++.dg/torture/pr51482.C 2025-11-25 19:31:33.043028798 +0100 @@ -22,7 +22,7 @@ WVECT * anim_track_bez_wvect::tangent(in g1.y = (p_p1->y - p_p0->y)*bp1; g1.z = (p_p1->z - p_p0->z)*bp1; g1.w = (p_p1->w - p_p0->w)*bp1; - bp1 = (0.5f + key_class*0.5f*continuity); + bp1 = (0.5f + ((int)key_class)*0.5f*continuity); p_tn->x = (g1.x + g3.x*bp1)*tn1; p_tn->y = (g1.y + g3.y*bp1)*tn1; p_tn->z = (g1.z + g3.z*bp1)*tn1; --- gcc/testsuite/g++.dg/tree-prof/partition1.C.jj 2025-11-17 09:39:19.248759943 +0100 +++ gcc/testsuite/g++.dg/tree-prof/partition1.C 2025-11-25 19:31:33.043257673 +0100 @@ -16,7 +16,8 @@ int bar (int i) void *p = __builtin_alloca (i); asm volatile ("" : : "r" (i), "r" (p) : "memory"); if (k) throw 6; - return ++l; + l = l + 1; + return l; } void foo () --- gcc/testsuite/obj-c++.dg/exceptions-3.mm.jj 2025-11-17 09:39:19.364758315 +0100 +++ gcc/testsuite/obj-c++.dg/exceptions-3.mm 2025-11-25 19:31:33.043481075 +0100 @@ -1,5 +1,5 @@ /* Contributed by Nicola Pero <[email protected]>, November 2010. */ -/* { dg-options "-fobjc-exceptions" } */ +/* { dg-options "-fobjc-exceptions -std=gnu++17" } */ /* { dg-do compile } */ // { dg-additional-options "-Wno-objc-root-class" } --- gcc/testsuite/obj-c++.dg/exceptions-5.mm.jj 2025-11-17 09:39:19.364758315 +0100 +++ gcc/testsuite/obj-c++.dg/exceptions-5.mm 2025-11-25 19:31:33.043712565 +0100 @@ -1,5 +1,5 @@ /* Contributed by Nicola Pero <[email protected]>, November 2010. */ -/* { dg-options "-fobjc-exceptions" } */ +/* { dg-options "-fobjc-exceptions -std=gnu++17" } */ /* { dg-do compile } */ // { dg-additional-options "-Wno-objc-root-class" } --- libgomp/testsuite/libgomp.c++/atomic-12.C.jj 2025-11-17 09:39:19.570755417 +0100 +++ libgomp/testsuite/libgomp.c++/atomic-12.C 2025-11-25 19:31:33.043969317 +0100 @@ -15,17 +15,17 @@ main () int v, *p; p = &x; #pragma omp atomic update - p[foo (), 0] = 16 + 6 - p[foo (), 0]; + p[(foo (), 0)] = 16 + 6 - p[(foo (), 0)]; #pragma omp atomic read v = x; if (cnt != 2 || v != 16) abort (); #pragma omp atomic capture - v = p[foo () + foo (), 0] = p[foo () + foo (), 0] + 3; + v = p[(foo () + foo (), 0)] = p[(foo () + foo (), 0)] + 3; if (cnt != 6 || v != 19) abort (); #pragma omp atomic capture - v = p[foo (), 0] = 12 * 1 / 2 + (foo (), 0) + p[foo (), 0]; + v = p[(foo (), 0)] = 12 * 1 / 2 + ((foo (), 0)) + p[(foo (), 0)]; if (cnt != 9 || v != 25) abort (); #pragma omp atomic capture @@ -46,7 +46,7 @@ main () abort (); #pragma omp atomic capture { - v = p[foo (), 0]; p[foo (), 0] = (foo (), 7) ? 13 : foo () + 6; + v = p[(foo (), 0)]; p[(foo (), 0)] = (foo (), 7) ? 13 : foo () + 6; } if (cnt != 19 || v != 1) abort (); --- libgomp/testsuite/libgomp.c++/loop-6.C.jj 2025-11-17 09:39:19.570755417 +0100 +++ libgomp/testsuite/libgomp.c++/loop-6.C 2025-11-25 19:31:33.044204689 +0100 @@ -5,7 +5,8 @@ extern "C" void abort (void); volatile int count; static int test(void) { - return ++count > 0; + count = count + 1; + return count > 0; } int i; --- libgomp/testsuite/libgomp.c++/atomic-13.C.jj 2025-11-17 09:39:19.570755417 +0100 +++ libgomp/testsuite/libgomp.c++/atomic-13.C 2025-11-25 19:31:33.044441083 +0100 @@ -17,17 +17,17 @@ bar () T v, *p; p = &x; #pragma omp atomic update - p[foo (), 0] = 16 + 6 - p[foo (), 0]; + p[(foo (), 0)] = 16 + 6 - p[(foo (), 0)]; #pragma omp atomic read v = x; if (cnt != 2 || v != 16) abort (); #pragma omp atomic capture - v = p[foo () + foo (), 0] = p[foo () + foo (), 0] + 3; + v = p[(foo () + foo (), 0)] = p[(foo () + foo (), 0)] + 3; if (cnt != 6 || v != 19) abort (); #pragma omp atomic capture - v = p[foo (), 0] = 12 * 1 / 2 + (foo (), 0) + p[foo (), 0]; + v = p[(foo (), 0)] = 12 * 1 / 2 + ((foo (), 0)) + p[(foo (), 0)]; if (cnt != 9 || v != 25) abort (); #pragma omp atomic capture @@ -48,7 +48,7 @@ bar () abort (); #pragma omp atomic capture { - v = p[foo (), 0]; p[foo (), 0] = (foo (), 7) ? 13 : foo () + 6; + v = p[(foo (), 0)]; p[(foo (), 0)] = (foo (), 7) ? 13 : foo () + 6; } if (cnt != 19 || v != 1) abort (); --- libgomp/testsuite/libgomp.c++/atomic-8.C.jj 2025-11-17 09:39:19.570755417 +0100 +++ libgomp/testsuite/libgomp.c++/atomic-8.C 2025-11-25 19:31:33.044680294 +0100 @@ -72,22 +72,22 @@ main () abort (); p = &x; #pragma omp atomic update - p[foo (), 0] = p[foo (), 0] - 16; + p[(foo (), 0)] = p[(foo (), 0)] - 16; #pragma omp atomic read v = x; if (cnt != 2 || v != 0) abort (); #pragma omp atomic capture { - p[foo (), 0] += 6; - v = p[foo (), 0]; + p[(foo (), 0)] += 6; + v = p[(foo (), 0)]; } if (cnt != 4 || v != 6) abort (); #pragma omp atomic capture { - v = p[foo (), 0]; - p[foo (), 0] += 6; + v = p[(foo (), 0)]; + p[(foo (), 0)] += 6; } if (cnt != 6 || v != 6) abort (); @@ -97,15 +97,15 @@ main () abort (); #pragma omp atomic capture { - p[foo (), 0] = p[foo (), 0] + 6; - v = p[foo (), 0]; + p[(foo (), 0)] = p[(foo (), 0)] + 6; + v = p[(foo (), 0)]; } if (cnt != 9 || v != 18) abort (); #pragma omp atomic capture { - v = p[foo (), 0]; - p[foo (), 0] = p[foo (), 0] + 6; + v = p[(foo (), 0)]; + p[(foo (), 0)] = p[(foo (), 0)] + 6; } if (cnt != 12 || v != 18) abort (); @@ -114,23 +114,23 @@ main () if (v != 24) abort (); #pragma omp atomic capture - { v = p[foo (), 0]; p[foo (), 0]++; } + { v = p[(foo (), 0)]; p[(foo (), 0)]++; } #pragma omp atomic capture - { v = p[foo (), 0]; ++p[foo (), 0]; } + { v = p[(foo (), 0)]; ++p[(foo (), 0)]; } #pragma omp atomic capture - { p[foo (), 0]++; v = p[foo (), 0]; } + { p[(foo (), 0)]++; v = p[(foo (), 0)]; } #pragma omp atomic capture - { ++p[foo (), 0]; v = p[foo (), 0]; } + { ++p[(foo (), 0)]; v = p[(foo (), 0)]; } if (cnt != 20 || v != 28) abort (); #pragma omp atomic capture - { v = p[foo (), 0]; p[foo (), 0]--; } + { v = p[(foo (), 0)]; p[(foo (), 0)]--; } #pragma omp atomic capture - { v = p[foo (), 0]; --p[foo (), 0]; } + { v = p[(foo (), 0)]; --p[(foo (), 0)]; } #pragma omp atomic capture - { p[foo (), 0]--; v = p[foo (), 0]; } + { p[(foo (), 0)]--; v = p[(foo (), 0)]; } #pragma omp atomic capture - { --p[foo (), 0]; v = p[foo (), 0]; } + { --p[(foo (), 0)]; v = p[(foo (), 0)]; } if (cnt != 28 || v != 24) abort (); return 0; --- libgomp/testsuite/libgomp.c++/pr38650.C.jj 2025-11-17 09:39:19.570755417 +0100 +++ libgomp/testsuite/libgomp.c++/pr38650.C 2025-11-25 19:31:33.044919784 +0100 @@ -1,5 +1,6 @@ // PR c++/38650 // { dg-do run } +// { dg-additional-options "-std=gnu++17" } #include <cstdlib> --- libgomp/testsuite/libgomp.c++/atomic-9.C.jj 2025-11-17 09:39:19.570755417 +0100 +++ libgomp/testsuite/libgomp.c++/atomic-9.C 2025-11-25 19:31:33.045169954 +0100 @@ -75,22 +75,22 @@ bar () abort (); p = &x; #pragma omp atomic update - p[foo (), 0] = p[foo (), 0] - 16; + p[(foo (), 0)] = p[(foo (), 0)] - 16; #pragma omp atomic read v = x; if (cnt != 2 || v != 0) abort (); #pragma omp atomic capture { - p[foo (), 0] += 6; - v = p[foo (), 0]; + p[(foo (), 0)] += 6; + v = p[(foo (), 0)]; } if (cnt != 4 || v != 6) abort (); #pragma omp atomic capture { - v = p[foo (), 0]; - p[foo (), 0] += 6; + v = p[(foo (), 0)]; + p[(foo (), 0)] += 6; } if (cnt != 6 || v != 6) abort (); @@ -100,15 +100,15 @@ bar () abort (); #pragma omp atomic capture { - p[foo (), 0] = p[foo (), 0] + 6; - v = p[foo (), 0]; + p[(foo (), 0)] = p[(foo (), 0)] + 6; + v = p[(foo (), 0)]; } if (cnt != 9 || v != 18) abort (); #pragma omp atomic capture { - v = p[foo (), 0]; - p[foo (), 0] = p[foo (), 0] + 6; + v = p[(foo (), 0)]; + p[(foo (), 0)] = p[(foo (), 0)] + 6; } if (cnt != 12 || v != 18) abort (); @@ -117,23 +117,23 @@ bar () if (v != 24) abort (); #pragma omp atomic capture - { v = p[foo (), 0]; p[foo (), 0]++; } + { v = p[(foo (), 0)]; p[(foo (), 0)]++; } #pragma omp atomic capture - { v = p[foo (), 0]; ++p[foo (), 0]; } + { v = p[(foo (), 0)]; ++p[(foo (), 0)]; } #pragma omp atomic capture - { p[foo (), 0]++; v = p[foo (), 0]; } + { p[(foo (), 0)]++; v = p[(foo (), 0)]; } #pragma omp atomic capture - { ++p[foo (), 0]; v = p[foo (), 0]; } + { ++p[(foo (), 0)]; v = p[(foo (), 0)]; } if (cnt != 20 || v != 28) abort (); #pragma omp atomic capture - { v = p[foo (), 0]; p[foo (), 0]--; } + { v = p[(foo (), 0)]; p[(foo (), 0)]--; } #pragma omp atomic capture - { v = p[foo (), 0]; --p[foo (), 0]; } + { v = p[(foo (), 0)]; --p[(foo (), 0)]; } #pragma omp atomic capture - { p[foo (), 0]--; v = p[foo (), 0]; } + { p[(foo (), 0)]--; v = p[(foo (), 0)]; } #pragma omp atomic capture - { --p[foo (), 0]; v = p[foo (), 0]; } + { --p[(foo (), 0)]; v = p[(foo (), 0)]; } if (cnt != 28 || v != 24) abort (); } --- libgomp/testsuite/libgomp.c++/target-lambda-1.C.jj 2025-11-17 09:42:31.024835584 +0100 +++ libgomp/testsuite/libgomp.c++/target-lambda-1.C 2025-11-25 19:31:33.055531878 +0100 @@ -20,7 +20,7 @@ struct S auto merge_data_func (int *iptr, int &b) { - auto fn = [=](void) -> bool + auto fn = [=,this](void) -> bool { bool mapped; uintptr_t hostptr = (uintptr_t) ptr; --- libgomp/testsuite/libgomp.c-c++-common/target-40.c.jj 2025-11-17 09:39:19.570755417 +0100 +++ libgomp/testsuite/libgomp.c-c++-common/target-40.c 2025-11-25 19:31:33.056493746 +0100 @@ -10,7 +10,7 @@ volatile int v; #pragma omp declare target to (v) typedef void (*fnp1) (void); typedef fnp1 (*fnp2) (void); -void f1 (void) { v++; } +void f1 (void) { v += 1; } void f2 (void) { v += 4; } void f3 (void) { v += 16; f1 (); } fnp1 f4 (void) { v += 64; return f2; } --- libgomp/testsuite/libgomp.c-c++-common/depend-iterator-2.c.jj 2025-11-17 09:39:19.570755417 +0100 +++ libgomp/testsuite/libgomp.c-c++-common/depend-iterator-2.c 2025-11-25 19:31:33.056703811 +0100 @@ -4,53 +4,53 @@ __attribute__((noipa)) void foo (int *p, int i) { #pragma omp task depend (out: p[0]) - v++; + v = v + 1; #pragma omp task depend (in: p[0]) - v++; + v = v + 1; #pragma omp task depend (inout: p[0]) - v++; + v = v + 1; #pragma omp task depend (mutexinoutset: p[0]) - v++; + v = v + 1; #pragma omp task depend (out: p[0]) depend (in: p[1]) - v++; + v = v + 1; #pragma omp task depend (in: p[0]) depend (inout: p[1]) - v++; + v = v + 1; #pragma omp task depend (inout: p[0]) depend (mutexinoutset: p[1]) - v++; + v = v + 1; #pragma omp task depend (mutexinoutset: p[0]) depend (out: p[1]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:2) , out : p[j]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:2) , in : p[j]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:2) , inout : p[j]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:2) , mutexinoutset : p[j]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:2) , out : p[j]) depend (iterator (j=0:2) , in : p[j + 2]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:2) , in : p[j]) depend (iterator (j=0:2) , inout : p[j + 2]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:2) , inout : p[j]) depend (iterator (j=0:2) , mutexinoutset : p[j + 2]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:2) , mutexinoutset : p[j]) depend (iterator (j=0:2) , out : p[j + 2]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:i) , out : p[j]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:i) , in : p[j]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:i) , inout : p[j]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:i) , mutexinoutset : p[j]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:i) , out : p[j]) depend (iterator (j=0:i) , in : p[j + 2]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:i) , in : p[j]) depend (iterator (j=0:i) , inout : p[j + 2]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:i) , inout : p[j]) depend (iterator (j=0:i) , mutexinoutset : p[j + 2]) - v++; + v = v + 1; #pragma omp task depend (iterator (j=0:i) , mutexinoutset : p[j]) depend (iterator (j=0:i) , out : p[j + 2]) - v++; + v = v + 1; } int
