RFR: 8086027: Multiple STATIC_ASSERTs at class scope doesn't work

Kim Barrett kim.barrett at oracle.com
Tue Jun 9 19:10:48 UTC 2015

On Jun 9, 2015, at 4:48 AM, Bengt Rutisson <bengt.rutisson at oracle.com> wrote:
>> CR:
>> https://bugs.openjdk.java.net/browse/JDK-8086027
>> Webrev:
>> http://cr.openjdk.java.net/~kbarrett/8086027/webrev.00/
> This looks good to me. One question about the test in debug.cpp:
> 792 // class scope
> 793 struct TestMultipleStaticAssertFormsInClassScope {
> I know struct and class are pretty much the same, but wouldn't it be more consistent to use class instead of struct here since the comment (and I think the spec) talk about class scope?

The definition of “class scope” makes no distinction for the introducing class-key.  The “class” and “struct”
class-keys are (so far as I can tell) identical other than their implications for initial accessibility.  (Despite
some compilers warning about mismatches in class-key usage between forward declarations and definitions.)
If I used “class” here rather than “struct” I would probably add “public:” to avoid any possibility of some
compiler whining about the unused typedefs.  (Although gcc -Wunused-local-typedefs will still hit us in the
function scope case; but I don’t think that’s a very interesting warning anyway, though as of gcc4.8 it’s part
of -Wall, which annoyed lots of people.)

> Either way is fine with me and in any case you don't need to send out another webrev.
> Thanks,
> Bengt

Thanks for reviewing.

More information about the hotspot-dev mailing list