1 //===----------------------------------------------------------------------===//
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-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-exceptions
11 // test bitset<N>& flip(size_t pos);
13 // Make sure we throw std::out_of_range when calling flip() on an OOB index.
19 int main(int, char**) {
22 try { v
.flip(0); assert(false); } catch (std::out_of_range
const&) { }
25 std::bitset
<1> v("0");
26 try { v
.flip(2); assert(false); } catch (std::out_of_range
const&) { }
29 std::bitset
<10> v("0000000000");
30 try { v
.flip(10); assert(false); } catch (std::out_of_range
const&) { }