krasimir added inline comments.

================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2485-2486
   if (Next->Next && Next->Next->is(tok::identifier) &&
-      !(Next->MatchingParen->Next && Next->MatchingParen->Next->is(tok::semi)))
+      (!Next->MatchingParen->Next ||
+       Next->MatchingParen->Next->is(tok::l_brace)))
     return true;
----------------
owenpan wrote:
> I was contemplating the above in https://reviews.llvm.org/D105964 and should 
> have used it instead. This is probably more conservative and accurate than 
> checking for an `l_brace` following the `r_paren`.
Thank you! 

Applied the suggestion. I was a bit worried that this suggestion won't work for 
function definitions with a trailing semicolon, but there the semicolon is not 
part of the same line as the function name, so all is good there. Added a few 
tests for this case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107269

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

Reply via email to