This is an archive of the discontinued LLVM Phabricator instance.

[libc++][NFC] Rename _LIBCPP_NODISCARD_ATTRIBUTE to _LIBCPP_NODISCARD
ClosedPublic

Authored by ldionne on Aug 30 2021, 1:02 PM.

Diff Detail

Event Timeline

ldionne requested review of this revision.Aug 30 2021, 1:02 PM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2021, 1:02 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript

LGTM % comment.

libcxx/include/type_traits
2343

This is the single solitary use of _LIBCPP_NODISCARD_ATTRIBUTE in the entire library, and I think it was a mistake. Let's just make this one _LIBCPP_NODISCARD_EXT for consistency. Then we can (continue to) decide what to do about _LIBCPP_NODISCARD_EXT in future PRs.

ldionne updated this revision to Diff 369695.Aug 31 2021, 7:25 AM
ldionne marked an inline comment as done.

Address review comments

ldionne added inline comments.Aug 31 2021, 8:31 AM
libcxx/include/type_traits
2343

Thinking about it further, I don't think we even want to make this nodiscard at all. It's an internal detail of the library anyway and I don't think anyone can mistake it for a modifying operation.

Quuxplusone added inline comments.
libcxx/include/type_traits
2343

Works for me. Ship it!

Mordante accepted this revision.Aug 31 2021, 9:53 AM
Mordante added a subscriber: Mordante.

LGTM!

libcxx/include/type_traits
2343

I've no strong opinion about this.

This revision is now accepted and ready to land.Aug 31 2021, 9:53 AM