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

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 1 11:21:53 PDT 2016

On Thu, Jun 30, 2016 at 01:41:00PM -0700, Richard Smith wrote:
> On Thu, Jun 30, 2016 at 2:02 AM, David Chisnall <david.chisnall at cl.cam.ac.uk
> > wrote:
> > On 29 Jun 2016, at 23:07, Richard Smith via cfe-dev <
> > cfe-dev at lists.llvm.org> wrote:
> > >
> > > 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.
> > >
> >
> > Could you clarify exactly what the issue is?  Currently, if I have some
> > legacy C++98 code, the odds are that it just compiles with ${CXX}.  If I
> > have new C++11 or C++14 code, then its build system likely sticks on the
> > required -std= flag and it builds independent of what the compiler default
> > is.
> >
> Why should new C++ code pay this tax to use the language that is currently
> called C++, that is taught as C++, that is covered by books on C++, and so
> on? C++98 is increasingly the odd one out, and it's the one where an
> explicit -std= flag should be required.

Well, if the C++ language wouldn't change in backwards incompatible
ways, we wouldn't have this discussion. As I said before, the compiler
authors are not the one paying the price for the breakage they
introduce. We've been moderately good with LLVM/Clang to not introduce
miscompiled code in the name of exploiting random UB. Changing the C++
version falls into pretty much the same category. I don't even
understand your point about paying a "tax" for using newer C++ features.
I find it pretty much the reverse actually. It clearly documents
requirements and makes them auditable as well. Given the complex
compatibility/implementation status of C++ across different systems,
that's a good thing and not something bad.


More information about the cfe-commits mailing list