https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/218707
`__WCHAR_WIDTH__` does not exist everywhere and this broke a builder: https://lab.llvm.org/buildbot/#/builders/2/builds/60118 >From ae58b406541ec8569604c44be4a13130e82d7777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]> Date: Tue, 25 Aug 2026 17:13:41 +0200 Subject: [PATCH] [clang][test] Use sizeof(wchar_t) instead of __WCHAR_WIDTH__ --- clang/unittests/AST/ByteCode/Pointer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/unittests/AST/ByteCode/Pointer.cpp b/clang/unittests/AST/ByteCode/Pointer.cpp index a42388d434c0c..bc45da69a0410 100644 --- a/clang/unittests/AST/ByteCode/Pointer.cpp +++ b/clang/unittests/AST/ByteCode/Pointer.cpp @@ -315,7 +315,7 @@ TEST(Pointer, Strings) { Pointee = GlobalPtr.load<Pointer>(); ASSERT_TRUE(Pointee.isStringPointer()); ASSERT_EQ(Pointee.getNumElems(), 7u); - ASSERT_EQ(Pointee.elemSize(), __WCHAR_WIDTH__ / 8u); + ASSERT_EQ(Pointee.elemSize(), sizeof(wchar_t)); D = match(varDecl(hasGlobalStorage(), hasName("c")).bind("c"), ASTCtx)[0] .getNodeAs<VarDecl>("c"); @@ -327,12 +327,12 @@ TEST(Pointer, Strings) { Pointee = GlobalPtr.load<Pointer>(); ASSERT_TRUE(Pointee.isStringPointer()); ASSERT_EQ(Pointee.getNumElems(), 7u); - ASSERT_EQ(Pointee.elemSize(), __WCHAR_WIDTH__ / 8u); + ASSERT_EQ(Pointee.elemSize(), sizeof(wchar_t)); ASSERT_EQ(Pointee.getIndex(), 5u); APValue APV = Pointee.toAPValue(ASTCtx); ASSERT_TRUE(APV.isLValue()); ASSERT_FALSE(APV.isLValueOnePastTheEnd()); - ASSERT_EQ(APV.getLValueOffset().getQuantity(), 5u * (__WCHAR_WIDTH__ / 8u)); + ASSERT_EQ(APV.getLValueOffset().getQuantity(), 5u * sizeof(wchar_t)); ASSERT_TRUE(APV.hasLValuePath()); const auto &Path = APV.getLValuePath(); ASSERT_EQ(Path.size(), 1u); _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
