RFR: 8067306: Improve STATIC_ASSERT
stefan.karlsson at oracle.com
Fri Dec 12 11:47:45 UTC 2014
On 2014-12-12 08:30, Kim Barrett wrote:
> Please review this enhancement to the hotspot STATIC_ASSERT() macro.
> I will also need a sponsor for this change.
> [Note: Although this is in "runtime", development was done in hs-gc
> rather than hs-rt, and I'd rather have it pushed via hs-gc. The point
> of making this change was that I wanted it for some other work I'm
> doing. I'd rather not wait for repo reconcilliation, and I don't think
> anyone else is champing at the bit for this.]
Why do you use '(cond) ? true : false' instead of just '(cond)'?
243 STATIC_ASSERT_FAILURE< (Cond) ? true : false >::value ] \
Why do you have this line at the end of the define:
244 /* */
> JPRT with temporary static assertions inserted at top-level, at class
> scope, and with value dependent on a template parameter, to verify the
> macro can now be used in those contexts. [The code base already
> contains several uses in function bodies, including with template
> JPRT with temporary intentional static assertion failures at
> top-level, class scope, function scope, and with value dependent on a
> template parameter, to verify expected failures occurred, and that the
> compiler error messages were informative.
More information about the hotspot-runtime-dev