-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang-format] Faulty RemoveParentheses: MultipleParentheses/ReturnStatement #81399
Comments
My bad, I just realized that $ cat foo.c
cat foo.c
#define PetscDefined_arg_1 shift,
#define PetscDefined_arg_ shift,
#define PetscDefined__take_second_expanded(ignored, val, ...) val
#define PetscDefined__take_second_expand(args) PetscDefined__take_second_expanded args
#define PetscDefined__take_second(...) PetscDefined__take_second_expand((__VA_ARGS__))
#define PetscDefined__(arg1_or_junk) PetscDefined__take_second(arg1_or_junk 1, 0, at_)
#define PetscDefined_(value) PetscDefined__(PetscConcat_(PetscDefined_arg_, value))
#define PetscDefined(def) PetscDefined_(PetscConcat(PETSC_, def))
#if PetscDefined(FOO)
#endif
$ clang -c foo.c 2>/dev/null; echo $?
0
$ clang-format -style='{RemoveParentheses: MultipleParentheses}' foo.c > bar.c
$ clang -c bar.c 2>/dev/null; echo $?
1 |
IMO |
Yes, I’m aware of the warning. If you don’t think think there is anything to be done on your side, feel free to close the issue. |
I'll disable removing parentheses in macro definitions. |
) Closes llvm#81399. (cherry picked from commit 4af24d4)
) Closes llvm#81399. (cherry picked from commit 4af24d4)
The text was updated successfully, but these errors were encountered: