[clang] [clang] Enforce 1-based indexing for command line source locations (PR #139457)
via cfe-commits
cfe-commits at lists.llvm.org
Sun May 11 09:25:36 PDT 2025
================
@@ -0,0 +1,6 @@
+// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:0:1 %s -o -
+// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:1:0 %s -o -
+
+// Related to #139375
+// Clang uses 1-based indexing for source locations given from the command-line.
+// Verify Clang doesn’t crash when 0 is given as line or column number.
----------------
cor3ntin wrote:
Can you add a test using FileCheck that we produce a diagnostic?
https://github.com/llvm/llvm-project/pull/139457
More information about the cfe-commits
mailing list