[llvm-branch-commits] [clang] [clang] Reject ranges getExpansionRangeInFile cannot represent (PR #214461)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Aug 6 06:19:51 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- clang/include/clang/Frontend/DiagnosticRenderer.h clang/lib/Frontend/DiagnosticRenderer.cpp clang/unittests/Frontend/TextDiagnosticTest.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/unittests/Frontend/TextDiagnosticTest.cpp b/clang/unittests/Frontend/TextDiagnosticTest.cpp
index 441e63f02..e3cdef2e9 100644
--- a/clang/unittests/Frontend/TextDiagnosticTest.cpp
+++ b/clang/unittests/Frontend/TextDiagnosticTest.cpp
@@ -192,8 +192,7 @@ TEST(GetExpansionRangeInFile, HandlesRangesTheContractRejectsOrRemaps) {
ASSERT_TRUE(MacroR);
EXPECT_EQ(SM.getFileID(MacroR->getBegin()), FID);
EXPECT_EQ(SM.getFileID(MacroR->getEnd()), FID);
- EXPECT_EQ(SM.getFileOffset(MacroR->getBegin()),
- SM.getFileOffset(Loc(2, 1)));
+ EXPECT_EQ(SM.getFileOffset(MacroR->getBegin()), SM.getFileOffset(Loc(2, 1)));
EXPECT_EQ(SM.getFileOffset(MacroR->getEnd()), SM.getFileOffset(Loc(2, 6)));
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/214461
More information about the llvm-branch-commits
mailing list