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