[PATCH] D109752: [clang-format] Top-level unwrapped lines don't follow a left brace

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 15 14:39:28 PDT 2021


owenpan added a comment.

It will prevent them from even being checked in `parseStructuralElement` as `IsTopLevel` is now `false`:

  case tok::l_paren: {
    parseParens();
    // Break the unwrapped line if a K&R C function definition has a parameter
    // declaration.
    if (!IsTopLevel || !Style.isCpp() || !Previous || FormatTok->is(tok::eof))
      break;
    const unsigned Position = Tokens->getPosition() + 1;
    assert(Position < AllTokens.size());
    if (isC78ParameterDecl(FormatTok, AllTokens[Position], Previous)) {
      addUnwrappedLine();
      return;
    }
    break;
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109752



More information about the cfe-commits mailing list