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

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 03:53:13 PDT 2023


tbaeder added inline comments.


================
Comment at: clang/test/FixIt/fixit-function-call.cpp:1
-// RUN: not %clang_cc1 -fdiagnostics-parseable-fixits -x c++ %s 2> %t
+// RUN: not %clang_cc1 -fdiagnostics-parseable-fixits -fno-diagnostics-show-line-numbers -fcaret-diagnostics-max-lines 1 -x c++ %s 2> %t
 // RUN: FileCheck %s < %t
----------------
aaron.ballman wrote:
> Just to double-check, parseable diagnostic output still works even if line numbers are shown, yes?
Yes, at leat we don't prepend the line numbers to the parseable fixits:
```
   21 | // CHECK-NEXT: fix-it{{.*}})
   22 | // CHECK: void f1(double *a);
   23 |   f1(a + 1);
      |      ~~~~~
      |      *(   )
fix-it:"../clang/test/FixIt/fixit-function-call.cpp":{23:6-23:6}:"*("
fix-it:"../clang/test/FixIt/fixit-function-call.cpp":{23:11-23:11}:")"
```


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

https://reviews.llvm.org/D147875



More information about the cfe-commits mailing list