https://bugs.llvm.org/show_bug.cgi?id=43890

            Bug ID: 43890
           Summary: P0031 should apply to std::array<T, 0> as well
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: jdoer...@google.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

Currently std::array<T,0>'s member functions miss constexpr qualifications as
specified by https://wg21.link/p0031. This results in the following code being
invalid, while it's handled fine by libstdc++ [1]:

  constexpr std::array<int, 0> a0 = {};
  constexpr auto ptr0 = a0.data();

Fixing this might require compiler magic, as reinterpret_cast is no longer
valid in std::array<T,0>::data().

[1] https://godbolt.org/z/04eTaL

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to