These [[nodiscard]] annotations are added as a conforming extension; it's unclear whether the paper will actually be adopted and make them mandatory, but they do seem like good ideas regardless. https://isocpp.org/files/papers/D2351R0.pdf This patch implements the paper's effect on: - std::to_integer, std::to_underlying - std::forward, std::move, std::move_if_noexcept - std::as_const - std::identity The paper also affects (but libc++ does not yet have an implementation of): - std::bit_cast
ldionne curdeius Mordante cor3ntin
- Group Reviewers
- rG4b7bad9eaea2: [libc++] Implement D2351R0 "Mark all library static cast wrappers as…
@ldionne: Good point. It turns out that there's a dedicated place to hang these new test cases! (Easily found by grepping libcxx/test/ for "nodiscard", once you'd pointed it out.)
I decided to go ahead and mention std::bit_cast in the test file, under a code comment, so that maybe whoever adds bit_cast will be grepping for it and find these tests and update them.