New user self-registration is currently disabled. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 1109 - Dynamic exception specifications are deprecated
Dynamic exception specifications are deprecated
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Core - general
unspecified
All All
: Normal Unknown
Assigned To: Nobody
:
Depends on:
Blocks: 3.3
  Show dependency treegraph
 
Reported: 2015-11-11 16:54 UTC by Gonzalo BG
Modified: 2015-12-10 14:49 UTC (History)
3 users (show)



Attachments

Description Gonzalo BG 2015-11-11 16:54:12 UTC
When using the macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW clang emits tons of warnings in C++14 mode of the form:

 warning: dynamic exception specifications are deprecated [-Wdeprecated]

Eigen3/Eigen/src/Core/util/Memory.h:613:62:  
note: expanded from macro 'EIGEN_MAKE_ALIGNED_OPERATOR_NEW_NOTHROW'

 void* operator new(size_t size, const std::nothrow_t&) throw() { \
                                                             ^~~~~~~
Since one cannot use compiler pragmas to push/pop these warnings when including Eigen3 headers (one has to do this at every point of use), it would be better if all dynamic exception specifications in Eigen3 would be abstracted behind a macro that can be configured.

For example replacing throw() with EIGEN_NO_THROW that is throw() in C++<11 and noexcept(true) in C++>=11. And if there is throw(some exceptions) that should be abstracted by a macro EIGEN_THROWS(...) that is throw(...) in C++<11 and noexcept(false) in C++>=11. 

Dynamic exception specifications will be removed from the language in C++17, and AFAIK what the compilers will do to retain backwards compatibility is the same thing I stated above (replace trow() with noexcept(true), and throw(...) with noexcept(false)).
Comment 1 Gael Guennebaud 2015-12-10 14:49:47 UTC
Thank you for the detailed report.

https://bitbucket.org/eigen/eigen/commits/0def1a78115d/

Note You need to log in before you can comment on or make changes to this bug.