This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Mar 2012 11:57:03 +0000
- Subject: [Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept
- Auto-submitted: auto-generated
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].