Clean up enum constants so that they're finally sane. Fixes PR3173 and a
recently introduced crash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91070 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 91fd166..0d55673 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -4522,7 +4522,7 @@
return FWIT->getWidth();
}
if (EnumType *ET = dyn_cast<EnumType>(T))
- T = ET->getDecl()->getPromotionType();
+ T = ET->getDecl()->getIntegerType();
// For builtin types, just use the standard type sizing method
return (unsigned)getTypeSize(T);
}