[clang] [clang-format] Treat new expressions as simple functions (PR #105168)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 22 00:45:10 PDT 2024
================
@@ -848,6 +848,8 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
const auto IsSimpleFunction = [&](const FormatToken &Tok) {
if (!Tok.FakeLParens.empty() && Tok.FakeLParens.back() > prec::Unknown)
return false;
+ if (Tok.is(tok::kw_new))
+ return true;
----------------
mydeveloperday wrote:
Should we leave a simple comment? I feel like at some point someone will complain that AlwaysBreak doesn't always Break.
I spent a bit of time here wondering if it should return true or skip to the next argument, I'm in two minds but I think this is ok.
https://github.com/llvm/llvm-project/pull/105168
More information about the cfe-commits
mailing list