]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: don't default -frange-for-ext-temps in -std=gnu++20 [PR188574]
authorJason Merrill <jason@redhat.com>
Tue, 11 Feb 2025 12:51:32 +0000 (13:51 +0100)
committerJason Merrill <jason@redhat.com>
Tue, 11 Feb 2025 23:07:51 +0000 (00:07 +0100)
commit556248d7d2cf557423993eb68f6a55ae6bda0cee
tree11a564ef7dedb3fd21280a96941c08da04615947
parent0d2a5f3cb715fd95f1fa4a13b5d67c7eea28f178
c++: don't default -frange-for-ext-temps in -std=gnu++20 [PR188574]

Since -frange-for-ext-temps has been causing trouble, let's not enable it
by default in pre-C++23 GNU modes for GCC 15, and also allow disabling it in
C++23 and up.

PR c++/188574

gcc/c-family/ChangeLog:

* c-opts.cc (c_common_post_options): Only enable
-frange-for-ext-temps by default in C++23.

gcc/ChangeLog:

* doc/invoke.texi: Adjust -frange-for-ext-temps documentation.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/range-for3.C: Use -frange-for-ext-temps.
* g++.dg/cpp23/range-for4.C: Adjust expected result.

libgomp/ChangeLog:

* testsuite/libgomp.c++/range-for-4.C: Adjust expected result.
gcc/c-family/c-opts.cc
gcc/doc/invoke.texi
gcc/testsuite/g++.dg/cpp23/range-for3.C
gcc/testsuite/g++.dg/cpp23/range-for4.C
libgomp/testsuite/libgomp.c++/range-for-4.C