Fixes a bug where enumerator type is not this
fixed type. // rdar://
10381507
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143724
91177308-0d34-0410-b5e6-
96231b3b80d8
unsigned NewWidth;
bool NewSign;
if (!getLangOptions().CPlusPlus &&
+ !Enum->isFixed() &&
isRepresentableIntegerValue(Context, InitVal, Context.IntTy)) {
NewTy = Context.IntTy;
NewWidth = IntWidth;
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// rdar://10381507
+
+typedef enum : long { Foo } IntegerEnum;
+int arr[(sizeof(typeof(Foo)) == sizeof(typeof(IntegerEnum))) - 1];
+int arr1[(sizeof(typeof(Foo)) == sizeof(typeof(long))) - 1];
+int arr2[(sizeof(typeof(IntegerEnum)) == sizeof(typeof(long))) - 1];