This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC support for C++ noexcept


On Sun, Jul 26, 2015 at 9:55 PM, Jeff Epler <jepler@unpythonic.net> wrote:
> Noexcept is a C++11 feature, so it has to be enabled by -std=c++11 or
> -std=gnu++11 (or, on some older gcc verions, -std=c++0x/gnu++0x)
>
> $ cat noex.cc
> void fn() noexcept(false);
> $ g++ -c noex.cc
> noex.cc:1:11: error: expected initializer before ânoexceptâ
>  void fn() noexcept(false);
>             ^
> $ g++ -std=c++11 -c noex.cc
> $

Right.

But these are sources that compile under both C++03 and C++11. If I
enable the macro for C++11, then I break C++03 because 03 won't know
what to do with 'noexcept(false)'.

Not defining __cpluplus makes things very difficult....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]