forked from OSchip/llvm-project
Add a test to make sure that implicit conversion from error_code to bool will fail
llvm-svn: 292969
This commit is contained in:
parent
081ad4d3e5
commit
86e7eae3a5
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue