This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Clarify documention of `bugprone-unchecked-optional-access`.
ClosedPublic

Authored by ymandel on Feb 10 2023, 8:55 AM.

Details

Summary

Removes a reference to google-internal document and expands the relevant material in place.

Fixes #60633.

Diff Detail

Event Timeline

ymandel created this revision.Feb 10 2023, 8:55 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: rnkovacs. · View Herald Transcript
ymandel requested review of this revision.Feb 10 2023, 8:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2023, 8:55 AM
xazax.hun added inline comments.Feb 10 2023, 9:24 AM
clang-tools-extra/docs/clang-tidy/checks/bugprone/unchecked-optional-access.rst
278

Strictly speaking, value on an empty optional will not terminate the program. It will raise an exception that can be handled.

(Of course, at Google, exceptions are banned so termination is right in that context.)

ymandel updated this revision to Diff 496527.Feb 10 2023, 9:39 AM

address comments

ymandel marked an inline comment as done.Feb 10 2023, 9:40 AM
ymandel added inline comments.
clang-tools-extra/docs/clang-tidy/checks/bugprone/unchecked-optional-access.rst
278

Right! Updated to mention both possibilities. Thx

xazax.hun accepted this revision.Feb 10 2023, 10:10 AM
This revision is now accepted and ready to land.Feb 10 2023, 10:10 AM
This revision was landed with ongoing or failed builds.Feb 10 2023, 10:15 AM
This revision was automatically updated to reflect the committed changes.
ymandel marked an inline comment as done.