]> granicus.if.org Git - clang/commitdiff
Specify an explicit underlying type for this enum to fix Windows
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 29 Jun 2018 20:41:23 +0000 (20:41 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 29 Jun 2018 20:41:23 +0000 (20:41 +0000)
buildbots.

On Windows targets, enums always get an underlying type of 'int', even
if they have wider enumerators. (This is non-conforming, but it's
effectively part of the target ABI.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336013 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/conv/conv.prom/p5.cpp

index baf51374c8cd557a025472d639a5088e5a280b09..0c72ebce4aa9a2e2ed4ff3a8fde0a9abaa16ddfa 100644 (file)
@@ -8,7 +8,7 @@ static_assert(sizeof(+X().e) == sizeof(int), "");
 static_assert(sizeof(X().e + 1) == sizeof(int), "");
 static_assert(sizeof(true ? X().e : 0) == sizeof(int), "");
 
-enum E { a = __LONG_LONG_MAX__ };
+enum E : long long { a = __LONG_LONG_MAX__ };
 static_assert(sizeof(E{}) == sizeof(long long), "");
 
 // If the bit-field has an enumerated type, it is treated as any other value of