Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -687,7 +687,7 @@ #define _NOALIAS #endif -#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) +#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || _GNUC_VER >= 406 # define _LIBCPP_EXPLICIT explicit #else # define _LIBCPP_EXPLICIT Index: test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.fail.cpp =================================================================== --- test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.fail.cpp +++ test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.fail.cpp @@ -0,0 +1,23 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// class error_code + +// explicit operator bool() const; + +#include + +int main() +{ + const std::error_code ec(0, std::generic_category()); + return ec; +} +