// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -std=c++11 -verify %s
// If an expression of literal class type is used in a context where an integral
// constant expression is required, then that class type shall have a single
// non-explicit conversion function to an integral or unscoped enumeration type
constexpr ok;
extern struct Incomplete incomplete; // expected-note 5{{forward decl}}
constexpr expl;
constexpr ambig;
constexpr int test_ok = ok; // ok
constexpr int ; // ok
constexpr int test_ambiguous = ambig; // ok
static_assert;
static_assert;
static_assert;
// [expr.new]p6: Every constant-expression in a noptr-new-declarator shall be
// an integral constant expression
auto new1 = new int;
auto new2 = new int; // expected-error {{incomplete}}
auto new3 = new int; // expected-error {{explicit conversion}}
auto new4 = new int; // expected-error {{ambiguous conversion}}
// [dcl.enum]p5: If the underlying type is not fixed [...] the initializing
// value [...] shall be an integral constant expression.
;
// [dcl.align]p2: When the alignment-specifier is of the form
// alignas(assignment-expression), the assignment-expression shall be an
// integral constant expression
alignas int alignas1;
alignas int alignas2; // expected-error {{incomplete}}
alignas int alignas3; // expected-error {{explicit conversion}}
alignas int alignas4; // expected-error {{ambiguous conversion}}
// [dcl.array]p1: If the constant-expression is present, it shall be an integral
// constant expression
int array1;
int array2; // expected-error {{incomplete}}
int array3; // expected-error {{explicit conversion}}
int array4; // expected-error {{ambiguous conversion}}
// [class.bit]p1: The constasnt-expression shall be an integral constant
// expression
;