brintos

brintos / llvm-project-archived public Read only

0
0
Text · 815 B · 449d3c2 Raw
34 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <system_error>10 11// class error_condition12 13// explicit operator bool() const;14 15#include <system_error>16#include <string>17#include <cassert>18 19#include "test_macros.h"20 21int main(int, char**)22{23    {24        const std::error_condition ec(6, std::generic_category());25        assert(static_cast<bool>(ec));26    }27    {28        const std::error_condition ec(0, std::generic_category());29        assert(!static_cast<bool>(ec));30    }31 32  return 0;33}34