[cfe-dev] RFC: Default language standard mode policy

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 15:07:33 PDT 2016


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160629/5c56c683/attachment-0001.html>


More information about the cfe-commits mailing list