//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11 // // class error_category // constexpr error_category() noexcept; #include #include #include #include class test1 : public std::error_category { public: constexpr test1() = default; // won't compile if error_category() is not constexpr virtual const char* name() const noexcept {return nullptr;} virtual std::string message(int) const {return std::string();} }; int main() { static_assert(std::is_nothrow_default_constructible::value, "error_category() must exist and be noexcept"); }