[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines as a driver option

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 8 21:42:13 PDT 2023


MaskRay added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:2303
+  Group<f_Group>, Flags<[NoXarchOption, CC1Option, CoreOption]>,
+  HelpText<"Set the maximum number of source lines to show in a caret diagnostic">,
+  MarshallingInfoInt<DiagnosticOpts<"SnippetLineLimit">, "DiagnosticOptions::DefaultSnippetLineLimit">;
----------------
Add ` (0 = no limit)` if useful


================
Comment at: clang/test/Driver/caret-diagnostics-max-lines.cpp:1
+//RUN: not %clang++ -fsyntax-only -fcaret-diagnostics-max-lines=2 %s 2>&1 | FileCheck %s -strict-whitespace
+
----------------
The `test/Driver` test just tests that `-fcaret-diagnostics-max-lines=2` is forwarded to CC1. The semantic tests are performed in other test directories, `Misc/caret-diags-multiline.cpp` in this case.


================
Comment at: clang/test/Driver/caret-diagnostics-max-lines.cpp:13
+// CHECK-NEXT: {{^}}      |     ~~~~~~~~~~{{$}}
+
----------------
Delete the trailing blank line


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

https://reviews.llvm.org/D152090



More information about the cfe-commits mailing list