-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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] Cannot recognize multiplication semantic of *
#99271
Labels
Comments
chestnykh
added a commit
to chestnykh/llvm-project
that referenced
this issue
Jul 17, 2024
clang-format cannot recognize that this is multiplication, not pointer declaration. See llvm#99271
chestnykh
added a commit
to chestnykh/llvm-project
that referenced
this issue
Jul 17, 2024
clang-format cannot recognize that this is multiplication, not pointer declaration. See llvm#99271
chestnykh
added a commit
to chestnykh/llvm-project
that referenced
this issue
Jul 17, 2024
clang-format cannot recognize that this is multiplication, not pointer declaration. See llvm#99271
Reduced repro: |
owenca
added a commit
to owenca/llvm-project
that referenced
this issue
Jul 18, 2024
sgundapa
pushed a commit
to sgundapa/upstream_effort
that referenced
this issue
Jul 23, 2024
chestnykh
added a commit
to chestnykh/llvm-project
that referenced
this issue
Jul 24, 2024
clang-format cannot recognize that this is multiplication, not pointer declaration. See llvm#99271
Reverted by 7e7a906. |
yuxuanchen1997
pushed a commit
that referenced
this issue
Jul 25, 2024
owenca
added a commit
to owenca/llvm-project
that referenced
this issue
Sep 3, 2024
A macro definition needs its own scope stack in the annotator, so we add the MacroBodyScopes stack and use ScopeStack to refer to it when in the macro definition body. Also, we need to have a scope type for a child block because its parent line is parsed (and thus the scope type for the braces is popped off the scope stack) before the lines in the child block are. Fixes llvm#99271.
That's intended. Instead, a min repro is e.g.:
|
owenca
added a commit
that referenced
this issue
Sep 4, 2024
A macro definition needs its own scope stack in the annotator, so we add the MacroBodyScopes stack and use ScopeStack to refer to it when in the macro definition body. Also, we need to have a scope type for a child block because its parent line is parsed (and thus the scope type for the braces is popped off the scope stack) before the lines in the child block are. Fixes #99271.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following sample
And .clang-format containing just
BasedOnStyle: LLVM
Then we get the output where clang-format made a 'pointer of type N' instead of multiplication:
The text was updated successfully, but these errors were encountered: