diff options
author | Jason Merrill <jason@redhat.com> | 2025-02-11 13:51:32 +0100 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-02-12 00:07:51 +0100 |
commit | 556248d7d2cf557423993eb68f6a55ae6bda0cee (patch) | |
tree | 11a564ef7dedb3fd21280a96941c08da04615947 /gcc/doc/invoke.texi | |
parent | 0d2a5f3cb715fd95f1fa4a13b5d67c7eea28f178 (diff) | |
download | gcc-556248d7d2cf557423993eb68f6a55ae6bda0cee.zip gcc-556248d7d2cf557423993eb68f6a55ae6bda0cee.tar.gz gcc-556248d7d2cf557423993eb68f6a55ae6bda0cee.tar.bz2 |
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.
Diffstat (limited to 'gcc/doc/invoke.texi')
-rw-r--r-- | gcc/doc/invoke.texi | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 0aef2ab..56d43cb 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -3548,9 +3548,8 @@ easier, you can use @option{-fno-pretty-templates} to disable them. Enable lifetime extension of C++ range based for temporaries. With @option{-std=c++23} and above this is part of the language standard, so lifetime of the temporaries is extended until the end of the loop -regardless of this option. This option allows enabling that behavior also -in earlier versions of the standard and is enabled by default in the -GNU dialects, from @option{-std=gnu++11} until @option{-std=gnu++20}. +by default. This option allows enabling that behavior also +in earlier versions of the standard. @opindex fno-rtti @opindex frtti |