GCC support for C++ noexcept

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm working with a library that has a class that throws in its dtor.
It dates back to the 1990s, so we are paying the tax now...

According to GCC 4.6 release notes
(https://gcc.gnu.org/gcc-4.6/changes.html), GCC got noexcept in 4.6.
However, I'm testing the change under MinGW with the 4.8.1 compiler.
Its resulting in:

g++ -DNDEBUG -g2 -O3 -march=native -Wall -Wextra -Wno-type-limits
-Wno-unknown-pragmas -pipe -c algparam.cpp
In file included from algparam.cpp:7:0:
algparam.h:262:2: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++0x-
compat]
  virtual ~AlgorithmParametersBase() CRYPTOPP_THROW
  ^
algparam.h:262:35: error: expected ';' at end of member declaration
  virtual ~AlgorithmParametersBase() CRYPTOPP_THROW
                                   ^
In file included from pch.h:10:0,
                 from algparam.cpp:3:
config.h:519:34: error: expected identifier before 'false'
 # define CRYPTOPP_THROW noexcept(false)
                                  ^
algparam.h:262:37: note: in expansion of macro 'CRYPTOPP_THROW'
  virtual ~AlgorithmParametersBase() CRYPTOPP_THROW
                                     ^
config.h:519:34: error: expected ',' or '...' before 'false'
 # define CRYPTOPP_THROW noexcept(false)

GCC does not appear to define __cplusplus under MinGW, so I can't
perform the test __cpluplus >= 201103L.

$ g++ -dM -E - < /dev/null | grep cplusplus
$

$ g++ -std=c++11 -dM -E - < /dev/null | grep cplusplus
cc1.exe: warning: command line option '-std=c++11' is valid for
C++/ObjC++ but not for C [enabled by default]=

How do I test for the noexcept feature?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux