[PATCH] D99031: [clang-format] Fix CompactNamespaces corner case when AllowShortLambdasOnASingleLine/BraceWrapping.BeforeLambdaBody are set
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 25 08:42:21 PDT 2021
HazardyKnusperkeks requested changes to this revision.
HazardyKnusperkeks added inline comments.
This revision now requires changes to proceed.
================
Comment at: clang/lib/Format/TokenAnnotator.cpp:3496-3501
+ assert(!Tok.is(tok::l_brace) || !Tok.is(BK_Block) ||
+ !Tok.isOneOf(TT_ObjCBlockLBrace, TT_DictLiteral) ||
+ (Tok.Previous && Tok.Previous->Previous));
return (Tok.is(tok::l_brace) && Tok.is(BK_Block) &&
- !Tok.isOneOf(TT_ObjCBlockLBrace, TT_DictLiteral));
+ !Tok.isOneOf(TT_ObjCBlockLBrace, TT_DictLiteral) &&
+ !Tok.Previous->Previous->is(tok::kw_namespace));
----------------
I find this really hard to read. Maybe you have to split the return.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99031/new/
https://reviews.llvm.org/D99031
More information about the cfe-commits
mailing list