[clang] [clang-format] Treat new expressions as simple functions (PR #105168)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 22 22:33:07 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;
----------------
owenca wrote:

We can also have `::new`. See https://en.cppreference.com/w/cpp/language/new.

https://github.com/llvm/llvm-project/pull/105168


More information about the cfe-commits mailing list