p4.cpp revision 7fcd13658e00e4d9e66cc86899e2c2973ee510fa
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
2
3enum X : short { A, B };
4extern decltype(+A) x;
5extern int x;
6
7enum Y : long { C, D };
8extern decltype(+C) y;
9extern long y;
10
11// An enum with a fixed underlying type has an integral promotion to that type,
12// and to its promoted type.
13enum B : bool { false_, true_ };
14template<bool> struct T {};
15T<false_> f;
16T<true_> t;
17// FIXME: DR1407 will make this ill-formed
18T<+true_> q; // desired-error {{conversion from 'int' to 'bool'}}
19
20enum B2 : bool {
21  a = false,
22  b = true,
23  c = false_,
24  d = true_,
25  // FIXME: DR1407 will make this ill-formed
26  e = +false_ // desired-error {{conversion from 'int' to 'bool'}}
27};
28