[PATCH] D99031: [clang-format] Fix CompactNamespaces corner case when AllowShortLambdasOnASingleLine/BraceWrapping.BeforeLambdaBody are set

Ahmed Mahdy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 30 18:56:58 PST 2022


aybassiouny added a comment.

Thanks @curdeius for checking this in, apologies for delay on my side. Glad the bug is not there in the new version!



================
Comment at: clang/lib/Format/TokenAnnotator.cpp:3498
+          !Tok.isOneOf(TT_ObjCBlockLBrace, TT_DictLiteral) &&
+          !Tok.Previous->Previous->is(tok::kw_namespace));
 }
----------------
curdeius wrote:
> Please add at least asserts for `Tok.Previous` and `Tok.Previous->Previous`.
I almost see no asserts despite similar usage, but sure 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99031



More information about the cfe-commits mailing list