This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Avoid bugprone-macro-parentheses warnings after goto argument
ClosedPublic

Authored by jubnzv on Apr 5 2021, 10:32 PM.

Details

Summary

clang-tidy should not generate bugprone-macro-parentheses warnings for the goto argument without parentheses, because it would be a syntax error.

The only valid case where an argument can be enclosed in parentheses is "Labels as Values" gcc extension: https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html.
But using this extension generates a syntax error in clang, so it cannot be checked with clang-tidy.

This commit fixes the following bugzilla issue: https://bugs.llvm.org/show_bug.cgi?id=49634

Diff Detail

Event Timeline

jubnzv created this revision.Apr 5 2021, 10:32 PM
jubnzv requested review of this revision.Apr 5 2021, 10:32 PM
jubnzv updated this revision to Diff 335421.Apr 6 2021, 12:26 AM
jubnzv updated this revision to Diff 335533.Apr 6 2021, 9:02 AM

Ping. Could somebody review this, please?

aaron.ballman accepted this revision.Apr 21 2021, 11:58 AM

LGTM, thank you!

This revision is now accepted and ready to land.Apr 21 2021, 11:58 AM

Adding the CFE mailing list, which was not on the review previously.

Adding the CFE mailing list, which was not on the review previously.

I think H744 needs updating to add cfe-commits. This used to be handled by the rule that adds clang to projects in clang-tools-extra but that has since been removed for clang-tools-extra.