This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Suppress google-objc-avoid-throwing-exception in system macros 🫢
ClosedPublic

Authored by stephanemoore on Nov 9 2022, 1:43 PM.

Details

Summary

The google-objc-avoid-throwing-exception check enforces the Google
Objective-C Style Guide's prohibition on throwing exceptions in user
code but the check incorrectly triggers findings for code emitted from
system headers. This commit suppresses any findings that do not have
valid locations or are emitted from macros in system headers.

Avoid Throwing Exceptions, Google Objective-C Style Guide:
https://github.com/google/styleguide/blob/gh-pages/objcguide.md#avoid-throwing-exceptions

Test Notes:
Ran clang-tidy lit tests.

Diff Detail

Event Timeline

stephanemoore created this revision.Nov 9 2022, 1:43 PM
Herald added a project: Restricted Project. · View Herald Transcript

[clang-tidy] Fix namespace comments in AvoidThrowingObjCExceptionCheck.cpp 🧹

This commit fixes namespace comments as suggested by the linter.

Restore original diff that was replaced by accident.

stephanemoore published this revision for review.Nov 9 2022, 1:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 9 2022, 1:59 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
stephanemoore added a subscriber: Eugene.Zelenko.

Included namespace comment linter fixes from D137740 as advised by @Eugene.Zelenko,

The false positives from this check are causing some disruption for XCTest framework users after some changes that we believe happened in Xcode 14. It would be nice if we could land some form of fix soon. I am happy to discuss options and iterate as needed.

gribozavr2 accepted this revision.Nov 30 2022, 3:02 PM
This revision is now accepted and ready to land.Nov 30 2022, 3:02 PM