[clang-tidy] Avoid bugprone-macro-parentheses warnings after goto argument
authorGeorgy Komarov <jubnzv@gmail.com>
Tue, 6 Apr 2021 04:57:47 +0000 (07:57 +0300)
committerGeorgy Komarov <jubnzv@gmail.com>
Thu, 22 Apr 2021 07:14:10 +0000 (10:14 +0300)
commit9a930aa5bd2fc4686002d02411141a19f0ad8f36
tree1c5a2c7f4ae165bd2d5fc94094dc0b00b48a546d
parent1dfb52a75687d6e6ca52fe49c879257011ba9538
[clang-tidy] Avoid bugprone-macro-parentheses warnings after goto argument

clang-tidy should not generate 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.
This commit adds support for the label-as-values extension as implemented in clang.

Fixes bugzilla issue 49634.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D99924
clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp