[llvm-bugs] [Bug 43890] New: P0031 should apply to std::array<T, 0> as well
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Nov 3 05:18:31 PST 2019
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: unassignedclangbugs at nondot.org
Reporter: jdoerrie at google.com
CC: llvm-bugs at lists.llvm.org, mclow.lists at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191103/be67ed33/attachment.html>
More information about the llvm-bugs
mailing list