[PATCH] D149562: [clang-format] Stop comment disrupting indentation of Verilog ports

sstwcw via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 07:11:48 PDT 2023


sstwcw added a comment.

> IMO a trailing comment (empty or not) belongs to the code before it.

There is only a parenthesis before it.  It doesn't usually need a comment.  It is like in 5a61139.  One doesn't tend to comment a single brace.

> A comment about the code below it should start on a new line.

In this special case, the comment would be indented to the same column as the next line, so it should be clear it is for the next line.  Like the case forbraced initializer lists, the first field will be on the same line as the brace if there isn't a comment, so the first comment is also on the same line as the brace when there is one.

  foo foo{// first field
          a,
          // second field
          b};


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149562



More information about the cfe-commits mailing list