Skip to content

Conversation

@H-G-Hristov
Copy link
Contributor

[[nodiscard]] should be applied to functions where discarding the return value is most likely a correctness issue.

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/nodiscard-to-optional branch 6 times, most recently from 416db44 to 40cf697 Compare December 1, 2025 06:25
@Zingam
Copy link
Contributor

Zingam commented Dec 1, 2025

@smallp-o-p Would you please review?

`[[nodiscard]]` should be applied to functions where discarding the return value is most likely a correctness issue.

- https://libcxx.llvm.org/CodingGuidelines.html
- https://wg21.link/optional
@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/nodiscard-to-optional branch from 40cf697 to ff99ffa Compare December 1, 2025 07:46
// Get the key function ~bad_optional_access() into the dylib
~bad_optional_access() _NOEXCEPT override;
const char* what() const _NOEXCEPT override;
[[__nodiscard__]] const char* what() const _NOEXCEPT override;
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change requested. I very wonder why we decided to expose bad_optional_access to old modes. @EricWF

H-G-Hristov and others added 2 commits December 1, 2025 20:28
@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/nodiscard-to-optional branch from fcd651d to 6e305c1 Compare December 2, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants