TargetParser: AArch64: Add part numbers for Apple CPUs.
[llvm-project.git] / clang / test / CXX / stmt.stmt / stmt.select / stmt.switch / p2-0x.cpp
blobfda0c5cff15326be667353ddf1417c1c7c0b45b0
1 // RUN: %clang_cc1 -std=c++11 %s -verify
2 // expected-no-diagnostics
4 struct Value {
5 constexpr Value(int n) : n(n) {}
6 constexpr operator short() const { return n; }
7 int n;
8 };
9 enum E { E0, E1 };
10 struct Alt {
11 constexpr operator E() const { return E0; }
14 constexpr short s = Alt();
16 void test(Value v) {
17 switch (v) {
18 case Alt():
19 case E1:
20 case Value(2):
21 case 3:
22 break;
24 switch (Alt a = Alt()) {
25 case Alt():
26 case E1:
27 case Value(2):
28 case 3:
29 break;
31 switch (E0) {
32 case Alt():
33 case E1:
34 // FIXME: These should produce a warning that 2 and 3 are not values of the
35 // enumeration.
36 case Value(2):
37 case 3:
38 break;