Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -683,7 +683,7 @@ #define _NOALIAS #endif -#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) +#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || defined(__GNUC__) # 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,28 @@ +//===----------------------------------------------------------------------===// +// +// 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 + +bool test_func(void) +{ + const std::error_code ec(0, std::generic_category()); + return ec; +} + +int main() +{ + return 0; +} +