[clang] Fix MSVC build after #206326 (again) (PR #207335)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 3 00:22:27 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Corentin Jabot (cor3ntin)

<details>
<summary>Changes</summary>

Adding /utf-8 is  bigger endeavor than I hoped, just disable the problematic test case for now

---
Full diff: https://github.com/llvm/llvm-project/pull/207335.diff


2 Files Affected:

- (modified) clang/unittests/Basic/CMakeLists.txt (-1) 
- (modified) clang/unittests/Basic/DiagnosticTest.cpp (+2-1) 


``````````diff
diff --git a/clang/unittests/Basic/CMakeLists.txt b/clang/unittests/Basic/CMakeLists.txt
index 016b6d5ddcb7b..058243fd3fdba 100644
--- a/clang/unittests/Basic/CMakeLists.txt
+++ b/clang/unittests/Basic/CMakeLists.txt
@@ -21,4 +21,3 @@ add_distinct_clang_unittest(BasicTests
   Support
   TargetParser
   )
-target_compile_options(BasicTests PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
diff --git a/clang/unittests/Basic/DiagnosticTest.cpp b/clang/unittests/Basic/DiagnosticTest.cpp
index 5cc0c39e5cb51..146673588b5a8 100644
--- a/clang/unittests/Basic/DiagnosticTest.cpp
+++ b/clang/unittests/Basic/DiagnosticTest.cpp
@@ -451,7 +451,8 @@ TEST_F(SuppressionMappingTest, CanonicalizesSlashesOnWindows) {
 
 TEST(DisplayCodePointForDiagnosticTest, printableDisplaysQuoted) {
   EXPECT_EQ(DisplayCodePointForDiagnostic(U'A'), "'A' U+0041");
-  EXPECT_EQ(DisplayCodePointForDiagnostic(U'🤡'), "'🤡' U+1F921");
+  // This test fails when msvc is not using /utf-8.
+  //EXPECT_EQ(DisplayCodePointForDiagnostic(U'🤡'), "'🤡' U+1F921");
   EXPECT_EQ(DisplayCodePointForDiagnostic(U' '), "' ' U+0020");
 }
 

``````````

</details>


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


More information about the cfe-commits mailing list