================
@@ -412,6 +414,15 @@ const FormatToken
*LeftRightQualifierAlignmentFixer::analyzeLeft(
// The case `const long long volatile int` -> `const volatile long long int`
// The case `long volatile long int const` -> `const volatile long long int`
if (TypeToken->isTypeName(LangOpts)) {
+ for (const auto *Prev = TypeToken->getPreviousNonComment();
+ Prev && Prev->is(tok::coloncolon);
+ Prev = Prev->getPreviousNonComment()) {
+ TypeToken = Prev;
+ Prev = Prev->getPreviousNonComment();
+ if (!(Prev && Prev->is(tok::identifier)))
----------------
owenca wrote:
Neither do I when the conditions inside the parentheses are unrelated.
Otherwise, I prefer the negated parentheses. Another example is `!(Foo == A ||
Foo == B || Foo == C)` (i.e. `Foo` is not one of `A`, `B`, and `C`) vs `Foo !=
A && Foo != B && Foo != C` (i.e. `Foo` is not `A`, not `B`, and not `C`). The
former is more readable to me.
https://github.com/llvm/llvm-project/pull/125327
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits