On 11/16/25 4:36 AM, Jakub Jelinek wrote:
On Mon, Nov 03, 2025 at 01:34:28PM -0500, Marek Polacek via Gcc wrote:
I would like us to declare that C++20 is no longer experimental and
change the default dialect to gnu++20.  Last time we changed the default
was over 5 years ago in GCC 11:
<https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=0801f419440c14f6772b28f763ad7d40f7f7a580>
and before that in 2015 in GCC 6.1, so this happens roughly every 5 years.

I had been hoping to move to C++20 in GCC 15 (see bug 113920), but at that time
libstdc++ still had incomplete C++20 support and the compiler had issues to iron
out (mangling of concepts, modules work, etc.).  Are we ready now?  Is anyone
aware of any blockers?  Presumably we still wouldn't enable Modules by default.

I'm willing to do the work if we decide that it's time to switch the default
C++ dialect (that includes updating cxx-status.html and adding a new caveat to
changes.html).

I haven't seen a patch posted for this, so just that something is posted
during stage1 if we decide to do it, here is a patch.
Whether to call C++20 as non-experimental except e.g. for modules and still
say modules are experimental and need -fmodules option is a question (after
all, I think we don't implement P1815R2 paper nor private module fragments
and maybe something else too).

Even if we decide not to do this for GCC 16, I think parts of the patch
would be still useful, like the testsuite changes to make the testsuite
eventually C++20 compatible, deprecating -std={c,gnu}++-2{a,b} in c.opt
at least.

And libcody will need certainly more work to make it play nicely with C++20,
for now I've tweaked cody.hh in the just posted patch and here just
arranged for libcody itself to be compiled with -std=c++11.  That is what
actually libcody does by default, except during bootstrap for stage2+
it gets silently overridden from toplevel makefile and so -std=c++11 isn't
passed anymore.

Bootstrapped/regtested on x86_64-linux and i686-linux.

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.
2025-11-15  Jakub Jelinek  <[email protected]>

gcc/
        * doc/invoke.texi (gnu++17): Remove comment about the default.
        (c++20): Remove note about experimental support.
        (gnu++20): Likewise.  Move here comment about the default.
        * 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++.
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.jj      2025-11-14 16:32:39.760789506 +0100
+++ gcc/doc/invoke.texi 2025-11-15 12:05:07.040849058 +0100
@@ -2627,21 +2627,17 @@ 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.
  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.
  The name @samp{gnu++2a} is deprecated.
@item c++23
--- gcc/doc/standards.texi.jj   2025-08-30 18:25:14.318525473 +0200
+++ gcc/doc/standards.texi      2025-11-15 12:06:43.547468824 +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-10 09:58:29.352171974 +0100
+++ gcc/c-family/c-opts.cc      2025-11-15 11:58:43.048340906 +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-11 07:21:30.420267317 +0100
+++ gcc/c-family/c.opt  2025-11-15 12:03:13.231476751 +0100
@@ -2614,15 +2614,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++
@@ -2716,15 +2716,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-07 10:35:07.923561326 
+0100
+++ gcc/testsuite/lib/target-supports.exp       2025-11-15 12:09:24.908161052 
+0100
@@ -12092,7 +12092,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-05-20 08:14:07.080396954 +0200
+++ gcc/testsuite/lib/g++-dg.exp        2025-11-15 12:17:57.410831276 +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     2020-01-12 11:54:37.153402244 
+0100
+++ gcc/testsuite/g++.dg/debug/pr80461.C        2025-11-15 22:23:26.844037801 
+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     2020-04-05 00:27:46.554215583 
+0200
+++ gcc/testsuite/g++.dg/debug/pr94459.C        2025-11-15 22:25:24.364486317 
+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      2020-01-12 
11:54:37.157402184 +0100
+++ gcc/testsuite/g++.dg/diagnostic/virtual-constexpr.C 2025-11-15 
22:26:04.209962311 +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   2020-01-12 11:54:37.182401807 
+0100
+++ gcc/testsuite/g++.dg/guality/pr67192.C      2025-11-15 22:33:24.105177270 
+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 2020-01-12 11:54:37.268400509 +0100
+++ gcc/testsuite/g++.dg/torture/pr84961-2.C    2025-11-15 22:30:10.011729785 
+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 2020-01-12 11:54:37.268400509 
+0100
+++ gcc/testsuite/g++.dg/torture/pr84961-1.C    2025-11-15 22:30:02.656826509 
+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   2020-01-12 11:54:37.263400585 
+0100
+++ gcc/testsuite/g++.dg/torture/pr51482.C      2025-11-15 22:28:50.674773142 
+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      2023-11-03 
14:27:47.872746354 +0100
+++ gcc/testsuite/g++.dg/tree-prof/partition1.C 2025-11-15 22:31:15.866863725 
+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 2020-11-13 13:50:23.362551572 
+0100
+++ gcc/testsuite/obj-c++.dg/exceptions-3.mm    2025-11-15 22:36:58.253615061 
+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 2020-11-13 13:50:23.362551572 +0100
+++ gcc/testsuite/obj-c++.dg/exceptions-5.mm    2025-11-15 22:37:07.960233367 
+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 2020-01-12 11:54:39.021374061 +0100
+++ libgomp/testsuite/libgomp.c++/atomic-12.C   2025-11-15 22:53:58.885742027 
+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   2020-01-11 16:31:56.767267532 
+0100
+++ libgomp/testsuite/libgomp.c++/loop-6.C      2025-11-15 22:39:09.343610860 
+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        2020-01-12 
11:54:39.021374061 +0100
+++ libgomp/testsuite/libgomp.c++/atomic-13.C   2025-11-15 22:54:33.824276419 
+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 2020-01-12 11:54:39.021374061 
+0100
+++ libgomp/testsuite/libgomp.c++/atomic-8.C    2025-11-15 22:47:18.469078172 
+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  2020-01-11 16:31:56.767267532 
+0100
+++ libgomp/testsuite/libgomp.c++/pr38650.C     2025-11-15 22:49:08.840607307 
+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 2020-01-12 11:54:39.021374061 +0100
+++ libgomp/testsuite/libgomp.c++/atomic-9.C    2025-11-15 22:47:39.557797133 
+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  2024-03-01 
17:27:53.001969975 +0100
+++ libgomp/testsuite/libgomp.c++/target-lambda-1.C     2025-11-15 
22:45:11.437771053 +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       2022-05-27 
12:48:40.753483857 +0200
+++ libgomp/testsuite/libgomp.c-c++-common/target-40.c  2025-11-15 
22:49:56.682969736 +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       
2020-01-12 11:54:39.027373971 +0100
+++ libgomp/testsuite/libgomp.c-c++-common/depend-iterator-2.c  2025-11-15 
22:50:32.412493587 +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
--- libcody/Makefile.in.jj      2023-06-16 12:01:15.028683773 +0200
+++ libcody/Makefile.in 2025-11-15 17:13:48.640759404 +0100
@@ -21,7 +21,7 @@ INSTALL := $(srcdir)/build-aux/install-s
  # 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


Reply via email to