[PATCH] Tame a few enum size tests when using -fshort-enums on ARM.

Jonathan Roelofs jonathan at codesourcery.com
Tue Aug 12 12:09:58 PDT 2014

On 8/12/14, 12:31 PM, Tim Northover wrote:
> Not really a review, as I don't know how these tests are supposed to work, but one comment that you may well know and have made an active decision on already (but just in case not)...
> ================
> Comment at: libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp:55
> @@ -54,1 +54,3 @@
>       test_make_signed< const wchar_t, std::conditional<sizeof(wchar_t) == 4, const int, const short>::type >();
> +    test_make_signed< const Enum, const signed char >();
> ----------------
> I think the preprocessor rules mean that __ARM_SIZEOF_MINIMAL_ENUM gets the notional value 0 if it's not defined, so you can probably skip the first condition if you want.
They do, but I find the other form to be harder to read correctly the first 
time. Not sure if there's much of a precedence for either style... I'm happy 
write it either way.

> http://reviews.llvm.org/D4869

Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded

More information about the cfe-commits mailing list