r336013 - Specify an explicit underlying type for this enum to fix Windows

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 29 13:41:24 PDT 2018


Author: rsmith
Date: Fri Jun 29 13:41:23 2018
New Revision: 336013

URL: http://llvm.org/viewvc/llvm-project?rev=336013&view=rev
Log:
Specify an explicit underlying type for this enum to fix Windows
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.)

Modified:
    cfe/trunk/test/CXX/conv/conv.prom/p5.cpp

Modified: cfe/trunk/test/CXX/conv/conv.prom/p5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/conv/conv.prom/p5.cpp?rev=336013&r1=336012&r2=336013&view=diff
==============================================================================
--- cfe/trunk/test/CXX/conv/conv.prom/p5.cpp (original)
+++ cfe/trunk/test/CXX/conv/conv.prom/p5.cpp Fri Jun 29 13:41:23 2018
@@ -8,7 +8,7 @@ static_assert(sizeof(+X().e) == sizeof(i
 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




More information about the cfe-commits mailing list