static bool isRepresentableIntegerValue(ASTContext &Context,
llvm::APSInt &Value,
QualType T) {
- assert(T->isIntegralType(Context) && "Integral type required!");
+ assert((T->isIntegralType(Context) || T->isEnumeralType()) &&
+ "Integral type required!");
unsigned BitWidth = Context.getIntWidth(T);
if (Value.isUnsigned() || Value.isNonNegative()) {
static QualType getNextLargerIntegralType(ASTContext &Context, QualType T) {
// FIXME: Int128/UInt128 support, which also needs to be introduced into
// enum checking below.
- assert(T->isIntegralType(Context) && "Integral type required!");
+ assert((T->isIntegralType(Context) ||
+ T->isEnumeralType()) && "Integral type required!");
const unsigned NumTypes = 4;
QualType SignedIntegralTypes[NumTypes] = {
Context.ShortTy, Context.IntTy, Context.LongTy, Context.LongLongTy
bool f() { return !f1(); } // expected-error {{invalid argument type 'test11::E2' (aka 'test11::E') to unary expression}}
}
+
+namespace PR35586 {
+ enum C { R, G, B };
+ enum B { F = (enum C) -1, T}; // this should compile cleanly, it used to assert.
+};