[cfe-dev] RFC: Default language standard mode policy
Joerg Sonnenberger via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 29 15:24:25 PDT 2016
On Wed, Jun 29, 2016 at 03:07:33PM -0700, Richard Smith wrote:
> On Wed, Jun 29, 2016 at 2:48 PM, Joerg Sonnenberger via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
> > On Wed, Jun 29, 2016 at 12:09:37PM -0700, Richard Smith via cfe-dev wrote:
> > > Hi all!
> > >
> > > I'd like to establish a policy for Clang's default language standard (if
> > > none is specified with -std), as follows:
> > >
> > > Clang defaults to the most recent published standard for the selected
> > > language that it fully implements.
> > >
> > > The practical impact of this is that clang++ will default to C++14 for
> > C++
> > > compilations (for version 3.9 onwards) and will default to C++17 once our
> > > implementation support is complete and the standard is published
> > (whichever
> > > happens later).
> > I don't have a problem with the C11 default, because the language impact
> > is minimal. That's quite different from C++ though and I am very
> > reluctant to update the default language even to C++11. There is a lot
> > of code in the wild that doesn't compile anymore due to stupid changes
> > like user-defined string literals or the narrowing (warning) changes.
> > Even worse are the nothrow changes for destructors, which silently break
> > valid C++03 code.
> Yes, those are real problems, but it's not reasonable for us to keep the
> default at C++98/03 forever. GCC has already taken the plunge here, so a
> lot of open-source code that doesn't work in C++11 onwards already
> explicitly specifies an appropriate -std= flag.
As usual with many decisions in GNUland, they are not the ones to pay
the price. Frankly, I don't understand your argument either. I find it
perfectly reasonable to demand that software specifies which of multiple
incompatible language versions it wants. This is even more important as
the default environment of clang+libc++ allows a good majority of C++11
More information about the cfe-commits