[libcxx-commits] [PATCH] D109056: [libc++] Reject volatile types in std::allocator
Joe Loser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 9 07:48:54 PDT 2021
jloser added a comment.
In D109056#2987735 <https://reviews.llvm.org/D109056#2987735>, @ldionne wrote:
> Instead, would it be possible to add a `static_assert` in `std::allocator` that we're not passing a volatile type, and leave this as completed? Technically, I think this requires no change at all (and so we are correct in saying that we implement it) since the program is free to be ill-formed if one passes a volatile type to `std::allocator` (well, the resulting `std::allocator<T>` is not required to be a `Cpp17Allocator`). But I think it's good to explicitly error-out.
>
> We could also add a libc++ specific test for that behavior.
That works for me. I just added a `static_assert` in `std::allocator` along with a `libc++` verify test. Let me know what you think.
We can gate the `static_assert` on C++17 and later if you prefer (since it was raised as a C++17 issue); right now I left it to apply to all standards.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109056/new/
https://reviews.llvm.org/D109056
More information about the libcxx-commits
mailing list