Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/enum44.C

raw
1 // PR c++/103825
2 // { dg-do compile { target c++11 } }
3
4 enum class Type { Pawn };
5 struct Piece {
6 Type type : 4;
7 };
8
9 void
10 foo ()
11 {
12 switch (Piece().type)
13 case Type::Pawn:;
14
15 auto x = Piece().type;
16 switch (x)
17 case Type::Pawn:;
18 }
19
20 enum class En {A};
21 struct St {En field :1;};
22
23 void
24 bar ()
25 {
26 volatile St s = {En::A};
27 switch(s.field) {
28 case En::A : break;
29 }
30 }