1 // { dg-do compile { target c++11 } }
5 // 4.5.3 constant expressions
9 constexpr A(int i) : val(i) { }
10 constexpr operator int() const { return val; }
11 constexpr operator long() const { return -1; }
16 template<int I> struct X { static const int i = I; };
19 X<a> x; // OK: unique conversion to int
20 int ar[X<a>::i]; // also OK
21 int ary[a]; // { dg-error "could not convert" } ambiguous conversion
22 // { dg-error "9:size of array .ary. has non-integral" "" { target c++11 } .-1 }