[all-commits] [llvm/llvm-project] 9a930a: [clang-tidy] Avoid bugprone-macro-parentheses warn...

Georgiy Komarov via All-commits all-commits at lists.llvm.org
Thu Apr 22 00:17:09 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a930aa5bd2fc4686002d02411141a19f0ad8f36
      https://github.com/llvm/llvm-project/commit/9a930aa5bd2fc4686002d02411141a19f0ad8f36
  Author: Georgy Komarov <jubnzv at gmail.com>
  Date:   2021-04-22 (Thu, 22 Apr 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/bugprone/MacroParenthesesCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/bugprone-macro-parentheses.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list