diff options
Diffstat (limited to 'test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp')
-rw-r--r-- | test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp b/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp new file mode 100644 index 0000000000000..83faa03d28fa7 --- /dev/null +++ b/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/clear.pass.cpp @@ -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. +// +//===----------------------------------------------------------------------===// + +// <system_error> + +// class error_code + +// void clear(); + +#include <system_error> +#include <cassert> + +int main() +{ + { + std::error_code ec; + ec.assign(6, std::generic_category()); + assert(ec.value() == 6); + assert(ec.category() == std::generic_category()); + ec.clear(); + assert(ec.value() == 0); + assert(ec.category() == std::system_category()); + } +} |