brintos

brintos / llvm-project-archived public Read only

0
0
Text · 829 B · be422f3 Raw
36 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s2// expected-no-diagnostics3 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-formed19T<+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-formed27  e = +false_ // desired-error {{conversion from 'int' to 'bool'}}28};29 30namespace GH56560 {31enum GH56560_1 : bool;32bool GH56560_2(GH56560_1 a, GH56560_1 b) {33    return a == b;34}35} // namespace GH5656036