-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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 misplaces *
in declaration of pointer to struct
#55810
Comments
@llvm/issue-subscribers-clang-format |
Having said that I kind of expect it to work with just PointerAlignment, (but I see it doesn't)
|
@llvm/issue-subscribers-bug |
@llvm/issue-subscribers-good-first-issue |
The problem is that if (PrevToken->Tok.isLiteral() ||
PrevToken->isOneOf(tok::r_paren, tok::r_square, tok::kw_true,
tok::kw_false, tok::r_brace)) {
return TT_BinaryOperator;
} By the way, I want to add new test cases in |
I build on windows (in a visual studio shell), and I do this (one time)
Then I do this in the build directory
|
My assumption would be that this will break one of the existing unit tests... you won't know until you try.. are you saying
template <class T,
class = typename ::std::enable_if<
::std::is_array<T>{} && ::std::is_array<T>{}>::type>
But you may be able to handle that case by something like: if (PrevToken->Tok.isLiteral() ||
PrevToken->isOneOf(tok::r_paren, tok::r_square, tok::kw_true,
- tok::kw_false, tok::r_brace))
+ tok::kw_false))
+ return TT_BinaryOperator;
+
+ if (PrevToken->is(tok::r_brace) && Tok.isOneOf(tok::amp, tok::ampamp))
return TT_BinaryOperator;
const FormatToken *NextNonParen = NextToken; |
@mydeveloperday You are right. Thanks a lot. |
Revision: https://reviews.llvm.org/D127873 |
Our code in BIND is auto-formatted with clang-format using a .clang-format configuration that includes
PointerAlignment: Right
andPointerBindsToType: false
When I run the following on the command line:
I get a space before
foop
, where I expected the last line to be} *foop;
The text was updated successfully, but these errors were encountered: