http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52562
Bug #: 52562
Summary: [C++11] Most type_info functions not noexcept
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: [email protected]
ReportedBy: [email protected]
gcc 4.8.0 20120302 (experimental) in C++11 mode rejects the following program:
//------
#include <typeinfo>
template<class T> T& lval() noexcept;
static_assert(noexcept(lval<std::type_info>().name()), "");
static_assert(noexcept(lval<std::type_info>().before(lval<std::type_info>())),
"");
static_assert(noexcept(lval<std::type_info>() == lval<std::type_info>()), "");
static_assert(noexcept(lval<std::type_info>() != lval<std::type_info>()), "");
//------
All four static assertions fail, because the corresponding member functions are
not declared as noexcept contrary to the library specification in 18.7.1
[type.info].