jaredgrubb added inline comments.

================
Comment at: clang/lib/Format/TokenAnnotator.cpp:5329
+  if (Right.is(tok::l_square) && Right.is(TT_AttributeSquare))
     return !Left.is(TT_AttributeSquare);
 
----------------
I broke this `if` into two pieces and restored an original `return true` for 
this part of the `if` that was changed in 2020 (via 
5a4ddbd69db2b0e09398214510501d0e59a0c30b).

The `return !Left...` was added to avoid breaking `[[` apart when reflowing a 
function-arg with C++11-style attribute (eg, `[[unused]]`). As far as I can 
tell, this check _really_ only matters if the code-path is the second-half of 
the original if (`Right.is(tok::l_square)...`). 

I couldn't imagine how there `Right.is(tok::kw___attribute)` needs the 
`Left`-check, so I think that patch is better split to differentiate (even 
though originally it didn't really have any conflicting effect).

Please let me know if my logic here is wrong (or I'm not making sense :) )


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145262/new/

https://reviews.llvm.org/D145262

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to