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

nullptr_t undefined in global namespace for clang+libstdc++

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • hotspot
    • b17

      JDK-8263721 uses `nullptr_t` in the global namespace. This is fine, since "nullptr_t is available in the global namespace when <stddef.h> is included" from https://en.cppreference.com/w/cpp/types/nullptr_t.

      However, the clang+libstdc++ combination does not work. The pure clang chain (clang+libc++) works fine, so one could argue this is a "user bug", not a clang bug. More details are covered at https://codereview.chromium.org/1558333002.

      Considering that clang+libstdc++ is not a uncommont combination, maybe it's better to revise the code to make that combination work.

      One workaround is to add the following to `globalDefinitions.hpp`:

      ```
      #include <cstddef>
      using nullptr_t = std::nullptr_t;
      ```

            stefank Stefan Karlsson
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: