GCC support for C++ noexcept

Jeff Epler jepler@unpythonic.net
Mon Jul 27 01:55:00 GMT 2015


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
$ 

Jeff



More information about the Gcc-help mailing list