[PATCH] D147875: [clang][Diagnostics] Show line numbers when printing code snippets

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 26 10:41:44 PDT 2023


PiotrZSL added a comment.

In D147875#4283135 <https://reviews.llvm.org/D147875#4283135>, @tbaeder wrote:

> CCing @njames93 since I have no idea how to properly fix the clang-tidy test failures.

I look into some of those tests, there are 1 way to fix them. Tried to `-fno-diagnostics-show-line-numbers` but clang-tidy got history of ignoring those diagnostic flags, I thing there are some issues open for it.

In those tests you got thing like this:

  // CHECK-MESSAGES-NEXT: ^~~
  // CHECK-MESSAGES-NEXT: {{^ *}}LU{{$}}

this could be changed into something like this:

  // CHECK-MESSAGES-NEXT: ^~~
  // CHECK-MESSAGES-NEXT: {{^ *\| *}}LU{{$}}

Simply this matching beginning of a line. by using `^ *\| *` we match: beginning of line, any number of white spaces, character `|` any number of white spaces.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147875



More information about the cfe-commits mailing list