<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56438>56438</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format assertion failure on -lines=0:n
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format,
crash
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
owenca
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
owenca
</td>
</tr>
</table>
<pre>
clang-format crashes if the starting line number is 0 for the `-lines` command-line option:
```
$ clang-format -version
clang-format version 15.0.0 (https://github.com/llvm/llvm-project c84d29acbfa671b4a7fb24764cbd4bfa5f6aad5c)
$ echo 'int i;' | clang-format -lines=0:1
Assertion failed: (Line && Col && "Line and column should start from 1!"), function translateLineCol, file SourceManager.cpp, line 1696.
...
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUsGO2yAQ_Rp8QbEwxnZ88CFNtKf21C8YMLapMESAt-rfdyBZbbO3SiPB8GDmvTdIP_-ZlAW3nhYfdkhUBYibjtQsNG2axgQhGbdSa5ym7tilDtREyijeLzdIz04ZjLihyu87uLkcUH9PxjvSXgi7EXZB_BmPlAv60vn0rkPMDwr8Aj0R2nQ1qxkl_LyldI-5NH_DWE3aDlljd0ysff9YTvfgf2mFqs5i5iMouUA_NFLAsEguhl4oOQs87JYeYO4U4eMnO602j70G4xI1pP2GW0qG6xfWD-3tjSGb5vH4EqMOWTtdwFg9I5I5f8-mEN5j0Ku3H1vCeUHQN_TPHrujcfOHnR_m0yX4nTaEY_DMj1_pcjhV6qcALlpIOlfAmgXElvSnP4LSP8DBqkOt7veMlKk0_djXD551XX8ZTTVP7Ty2I1TJJKtfvwa8yDoCTti96nfVEez0f7PB1MR4YA3-1vWiPVfbtDDRiGEGOAuuYOAdyH6WY68a0Yme6cqC1DZOpMOh8H9JFo-u2dPykXPa3SozccY5G9gZC4_tUPfAFIhZDl3-FEwQwfSOourMrPZhrcJUSMpjjQhaE1P8BNEJszqtnwT8b-0UPHvBkTYfpsdZVaRNRddfRnwRpQ">