[all-commits] [llvm/llvm-project] 7b7170: [clang-format] avoid introducing multiline comments

Krasimir Georgiev via All-commits all-commits at lists.llvm.org
Mon Nov 9 06:30:48 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b7170fa5791a8fcf28418e6daa1ab7dd2126a25
      https://github.com/llvm/llvm-project/commit/7b7170fa5791a8fcf28418e6daa1ab7dd2126a25
  Author: Krasimir Georgiev <krasimir at google.com>
  Date:   2020-11-09 (Mon, 09 Nov 2020)

  Changed paths:
    M clang/lib/Format/BreakableToken.cpp
    M clang/unittests/Format/FormatTestComments.cpp

  Log Message:
  -----------
  [clang-format] avoid introducing multiline comments

In C++ with -Werror=comment, multiline comments are not allowed.
clang-format could accidentally introduce multiline comments when reflowing.
This adapts clang-format to not introduce multiline comments by not allowing a
break after `\`. Note that this does not apply to comment lines that already are
multiline comments, such as comments in macros.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D90949




More information about the All-commits mailing list