[clang][Diagnostics] Fix diagnostic line numbers
authorTimm Bäder <tbaeder@redhat.com>
Tue, 27 Jun 2023 09:33:22 +0000 (11:33 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Fri, 30 Jun 2023 08:57:10 +0000 (10:57 +0200)
commit8554a55d041f2c7de329adda538cadf7eeb6e8a8
tree3c4fe6f4ff160e29df6cfc4daea8954dd004f753
parent550fa4eabd83d133595c7a5a07d54fc029b73733
[clang][Diagnostics] Fix diagnostic line numbers

The first line of the code snippet we print is potentially lower than
the caret line, so handle that case.

Fixes #63524

Differential Revision: https://reviews.llvm.org/D153849
clang/lib/Frontend/TextDiagnostic.cpp
clang/test/Misc/diag-style.cpp