// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s

enum X : short { A, B };
extern decltype(+A) x;
extern int x;

enum Y : long { C, D };
extern decltype(+C) y;
extern long y;

// An enum with a fixed underlying type has an integral promotion to that type,
// and to its promoted type.
enum B : bool { false_, true_ };
template<bool> struct T {};
T<false_> f;
T<true_> t;
T<+true_> t; // expected-error {{conversion from 'int' to 'bool'}}

enum B2 : bool {
  a = false,
  b = true,
  c = false_,
  d = true_,
  e = +false_ // expected-error {{conversion from 'int' to 'bool'}} \
              // FIXME: expected-error {{enumerator value 2 is not representable}}
};

// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s

enum X : short { A, B };
extern decltype(+A) x;
extern int x;

enum Y : long { C, D };
extern decltype(+C) y;
extern long y;

// An enum with a fixed underlying type has an integral promotion to that type,
// and to its promoted type.
enum B : bool { false_, true_ };
template<bool> struct T {};
T<false_> f;
T<true_> t;
// FIXME: DR1407 will make this ill-formed for a different reason.
T<+true_> q; // desired-error {{conversion from 'int' to 'bool'}}

enum B2 : bool {
  a = false,
  b = true,
  c = false_,
  d = true_,
  // FIXME: DR1407 will make this ill-formed
  e = +false_ // desired-error {{conversion from 'int' to 'bool'}}
};

Fix up after r163846. Sorry!
Fix up after r163846. Sorry!


git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@163849 91177308-0d34-0410-b5e6-96231b3b80d8
