[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Wed May 14 21:49:53 PDT 2025


================
@@ -89,8 +92,13 @@ struct ParsedSourceRange {
         // probably belongs to the filename which menas the whole
         // string should be parsed.
         RangeSplit.first = Str;
-      } else
+      } else {
+        // Column and line numbers are 1-based
----------------
MaskRay wrote:

Ensure that full sentences in commends end with `.`

Remove brace for this single-line-simple-body case per https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements

https://github.com/llvm/llvm-project/pull/139457


More information about the cfe-commits mailing list