[PATCH] Add -std=c++2a

Andrew Sutton andrew.n.sutton@gmail.com
Thu Jul 20 17:25:00 GMT 2017


For now, I think these two are incompatible. There are more features
in -fconcepts than in C++20 (so far). There are also some changes in
syntax and semantics that would be nice to diagnose. A good example
would be 'concept' as a decl-specifier (TS) vs. 'concept' as a
declaration introducer (WD).

I was going to submit a followup that emits a warning when both
-std=c++2a and -fconcepts are both enabled and then disables
-fconcepts.

Andrew Sutton


On Thu, Jul 20, 2017 at 1:04 PM, Markus Trippelsdorf
<markus@trippelsdorf.de> wrote:
> On 2017.07.20 at 09:33 -0400, Andrew Sutton wrote:
>> This adds a new C++ dialect, enabled by -std=c++2a.
>>
>>         libcpp/
>>         Add support for C++2a.
>>         * include/cpplib.h (c_lang): Add CXX2A and GNUCXX2A.
>>         * init.c (lang_defaults): Add rows for CXX2A and GNUCXX2A.
>>         (cpp_init_builtins): Set __cplusplus to 201707L for C++2x.
>>
>>         gcc/c-family/
>>         Add support for -std=c++2a.
>>         * c-common.h (cxx_dialect): Add cxx2a as a dialect.
>>         * opt.c: Add options for -std=c++2a and -std=gnu++2a.
>>         * c-opts.c (set_std_cxx2a): New.
>>         (c_common_handle_option): Set options when -std=c++2a is enabled.
>>
>>         gcc/testsuite/
>>         New test for -std=c++2a.
>>         * g++.dg/cpp2a/cplusplus.C: New.
>
> Perhaps you should enable -fconcepts by default?
>
> --
> Markus



More information about the Gcc-patches mailing list