This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/52562] New: [C++11] Most type_info functions not noexcept


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].


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]