Add a test to make sure that implicit conversion from error_code to bool will fail

llvm-svn: 292969
This commit is contained in:
Marshall Clow 2017-01-24 19:44:55 +00:00
parent 081ad4d3e5
commit 86e7eae3a5
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
//===----------------------------------------------------------------------===//
//
// 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.
//
//===----------------------------------------------------------------------===//
// XFAIL: c++03
// <system_error>
// class error_code
// explicit operator bool() const;
#include <system_error>
bool test_func(void)
{
const std::error_code ec(0, std::generic_category());
return ec; // conversion to bool is explicit; should fail.
}
int main()
{
return 0;
}