]>
Commit | Line | Data |
---|---|---|
9b46e4d6 JW |
1 | // { dg-do compile { target c++11 } } |
2 | // { dg-options "-Wall" } | |
bd80bd9b BK |
3 | // -*- C++ -*- |
4 | ||
99dee823 | 5 | // Copyright (C) 2004-2021 Free Software Foundation, Inc. |
bd80bd9b BK |
6 | |
7 | // This library is free software; you can redistribute it and/or | |
8 | // modify it under the terms of the GNU General Public License as | |
748086b7 | 9 | // published by the Free Software Foundation; either version 3, or (at |
bd80bd9b BK |
10 | // your option) any later version. |
11 | ||
12 | // This library is distributed in the hope that it will be useful, but | |
13 | // WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | // General Public License for more details. | |
16 | ||
17 | // You should have received a copy of the GNU General Public License | |
748086b7 JJ |
18 | // along with this library; see the file COPYING3. If not see |
19 | // <http://www.gnu.org/licenses/>. | |
bd80bd9b | 20 | |
bd80bd9b BK |
21 | |
22 | // Benjamin Kosnik <bkoz@redhat.com> | |
23 | ||
24 | #include <ios> | |
25 | ||
26 | // PR libstdc++/17922 | |
27 | // -Wall | |
28 | typedef std::ios_base::openmode bitmask_type; | |
29 | ||
30 | void | |
31 | case_labels(bitmask_type b) | |
32 | { | |
33 | switch (b) | |
34 | { | |
35 | case std::ios_base::app: | |
36 | break; | |
37 | case std::ios_base::ate: | |
38 | break; | |
39 | case std::ios_base::binary: | |
40 | break; | |
41 | case std::ios_base::in: | |
42 | break; | |
43 | case std::ios_base::out: | |
44 | break; | |
45 | case std::ios_base::trunc: | |
46 | break; | |
47 | case std::_S_ios_openmode_end: | |
48 | break; | |
75837d7b | 49 | case __INT_MAX__: |
fbfae2f0 | 50 | break; |
75837d7b | 51 | case ~__INT_MAX__: |
fbfae2f0 | 52 | break; |
bd80bd9b | 53 | } |
9b46e4d6 JW |
54 | using underlying_type = std::underlying_type<bitmask_type>::type; |
55 | static_assert( sizeof(underlying_type) == sizeof(int), | |
75837d7b | 56 | "underlying type has same range of values as int"); |
bd80bd9b | 57 | } |