This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Add -Wparentheses warnings for macros (PR 18971)
AbandonedPublic

Authored by NutshellySima on Feb 27 2018, 11:04 AM.

Details

Reviewers
rsmith
Summary

Before, clang does not warn -Wlogical-op-parentheses and -Wbitwise-op-parentheses in macros, thus miss some cases like PR 18971 and mismatch gcc's behavior.

Fix this by enabling the warning even when the expression is in macros.

Patch by Chijun Sima.

Diff Detail

Event Timeline

NutshellySima created this revision.Feb 27 2018, 11:04 AM

Tests?

Thanks for your advice, I'll add one.

NutshellySima abandoned this revision.Mar 24 2018, 9:42 AM