On Thu, May 14, 2020 at 11:53 PM Jason Merrill via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > There seemed to be general agreement last November that we would move to > allowing C++11 features to be used in GCC 11; this patch implements that > direction. Are changes needed anywhere else? > > ChangeLog > 2020-05-14 Jason Merrill <ja...@redhat.com> > > * configure.ac: Update bootstrap dialect to -std=gnu++11. > > gcc/ChangeLog > 2020-05-14 Jason Merrill <ja...@redhat.com> > > * doc/install.texi (Prerequisites): Update boostrap compiler > requirement to C++11/GCC 4.8. > --- > gcc/doc/install.texi | 14 ++++++++------ > configure.ac | 6 +++--- > ChangeLog | 4 ++++ > configure | 6 +++--- > 4 files changed, 18 insertions(+), 12 deletions(-) > > diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi > index 876b04f9c45..f47e3c76f73 100644 > --- a/gcc/doc/install.texi > +++ b/gcc/doc/install.texi > @@ -238,15 +238,17 @@ described below. > > @heading Tools/packages necessary for building GCC > @table @asis > -@item ISO C++98 compiler > -Necessary to bootstrap GCC, although versions of GCC prior > -to 4.8 also allow bootstrapping with a ISO C89 compiler and versions > -of GCC prior to 3.4 also allow bootstrapping with a traditional > -(K&R) C compiler. > +@item ISO C++11 compiler > +Necessary to bootstrap GCC. > + > +Versions of GCC prior to 11 also allow bootstrapping with an ISO C++98 > +compiler, versions of GCC prior to 4.8 also allow bootstrapping with a > +ISO C89 compiler, and versions of GCC prior to 3.4 also allow > +bootstrapping with a traditional (K&R) C compiler. > > To build all languages in a cross-compiler or other configuration where > 3-stage bootstrap is not performed, you need to start with an existing > -GCC binary (version 3.4 or later) because source code for language > +GCC binary (version 4.8 or later) because source code for language > frontends other than C might use GCC extensions. > > Note that to bootstrap GCC with versions of GCC earlier than 3.4, you > diff --git a/configure.ac b/configure.ac > index c78d9cbea62..63d92b73061 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1462,10 +1462,10 @@ case "$have_compiler:$host:$target:$enable_bootstrap" > in > ;; > esac > > -# When bootstrapping with GCC, build stage 1 in C++98 mode to ensure that a > -# C++98 compiler can still start the bootstrap. > +# When bootstrapping with GCC, build stage 1 in C++11 mode to ensure that a > +# C++11 compiler can still start the bootstrap. > if test "$enable_bootstrap:$GXX" = "yes:yes"; then > - CXX="$CXX -std=gnu++98" > + CXX="$CXX -std=gnu++11"
So I just spotted this - since we're requiring a ISO C++11 compiler shouldn't we build stage1 with -std=c++11 rather than gnu++11 (whatever the detailed differences are here)? Also not sure what level of -pedantic we'd need to avoid GNU extensions even with -std=c++11. Of course there are (I hope) a lot less GNU extensions for C++ than there were for C and hopefully no extra in gnu++11 compared to gnu++98 which we checked previously. Note I think what's missing is some general blurb in our coding conventions as to how much of C++11 we are supposed to use in non-infrastructure parts of GCC (I expect things like hash-table.h to use more C++ features than, say, tree-ssa-alias.c). There also does not seem to be a configure check which may present users with a more useful error message than later cryptic fail of build? I suppose we cannot simply check __cplusplus for this, can we? Do other common host compilers need additional options to enable C++11? Should we try to second guess such flags via configury? For example GCC 4.8 defaults to -std=gnu++98 and the above only seems to apply to the bootstrap case so GCC 4.8 cannot be used to build cross compilers without adjusting CC and CXX? Thanks, Richard. > fi > > # Used for setting $lt_cv_objdir > diff --git a/ChangeLog b/ChangeLog > index a7fcf77b9b2..1d281855a3e 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,7 @@ > +2020-05-14 Jason Merrill <ja...@redhat.com> > + > + * configure.ac: Update bootstrap dialect to -std=gnu++11. > + > 2020-04-29 Thomas Schwinge <tho...@codesourcery.com> > > PR target/92713 > diff --git a/configure b/configure > index 4cc938ebb7d..9b39035bbcc 100755 > --- a/configure > +++ b/configure > @@ -5523,10 +5523,10 @@ $as_echo "$as_me: WARNING: trying to bootstrap a > cross compiler" >&2;} > ;; > esac > > -# When bootstrapping with GCC, build stage 1 in C++98 mode to ensure that a > -# C++98 compiler can still start the bootstrap. > +# When bootstrapping with GCC, build stage 1 in C++11 mode to ensure that a > +# C++11 compiler can still start the bootstrap. > if test "$enable_bootstrap:$GXX" = "yes:yes"; then > - CXX="$CXX -std=gnu++98" > + CXX="$CXX -std=gnu++11" > fi > > # Used for setting $lt_cv_objdir > > base-commit: 4e1592f8e1d6366699e05c0824fc3dc39ca7314b > -- > 2.18.1 >