[Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Mon Mar 12 11:57:00 GMT 2012
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: unassigned@gcc.gnu.org
ReportedBy: daniel.kruegler@googlemail.com
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].
More information about the Gcc-bugs
mailing list