Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8275717

Reimplement STATIC_ASSERT to use static_assert

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • Resolved In Build:
      b21

      Description

      We currently have a bespoke implementation of STATIC_ASSERT, which was added before we transitioned over to C++14. I recently saw some compiler warnings about that implementation. I propose that we reimplement STATIC_ASSERT to use static_assert.

      An alternative would be to completely remove STATIC_ASSERT. That would change > 400 usages. Moreover, static_assert requires message string. That changes with C++17, so maybe wait with removing STATIC_ASSERT until then?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stefank Stefan Karlsson
              Reporter:
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: