diff options
author | Kazu Hirata <kazu@google.com> | 2025-09-14 20:31:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-14 20:31:55 -0700 |
commit | 1e3dd5ef29464b86005705bebec721ac5933bd85 (patch) | |
tree | 2197a2af199de8f0ffcb441b4c63eb647e164d2f /llvm/unittests/ADT/StringRefTest.cpp | |
parent | b15719365861502cd1c6d216ad4a0425ee6431ea (diff) | |
download | llvm-1e3dd5ef29464b86005705bebec721ac5933bd85.zip llvm-1e3dd5ef29464b86005705bebec721ac5933bd85.tar.gz llvm-1e3dd5ef29464b86005705bebec721ac5933bd85.tar.bz2 |
[llvm] Use std::bool_constant (NFC) (#158520)
This patch replaces, std::integral_constant<bool, ...> with
std::bool_constant for brevity. Note that std::bool_constant was
introduced as part of C++17.
There are cases where we could replace EXPECT_EQ(false, ...) with
EXPECT_FALSE(...), but I'm not doing that in this patch to avoid doing
multiple things in one patch.
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/StringRefTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp index d5f8dc4..1ace29e 100644 --- a/llvm/unittests/ADT/StringRefTest.cpp +++ b/llvm/unittests/ADT/StringRefTest.cpp @@ -1124,14 +1124,13 @@ TEST(StringRefTest, StringLiteral) { constexpr StringRef StringRefs[] = {"Foo", "Bar"}; EXPECT_EQ(StringRef("Foo"), StringRefs[0]); EXPECT_EQ(3u, (std::integral_constant<size_t, StringRefs[0].size()>::value)); - EXPECT_EQ(false, - (std::integral_constant<bool, StringRefs[0].empty()>::value)); + EXPECT_EQ(false, (std::bool_constant<StringRefs[0].empty()>::value)); EXPECT_EQ(StringRef("Bar"), StringRefs[1]); constexpr StringLiteral Strings[] = {"Foo", "Bar"}; EXPECT_EQ(StringRef("Foo"), Strings[0]); EXPECT_EQ(3u, (std::integral_constant<size_t, Strings[0].size()>::value)); - EXPECT_EQ(false, (std::integral_constant<bool, Strings[0].empty()>::value)); + EXPECT_EQ(false, (std::bool_constant<Strings[0].empty()>::value)); EXPECT_EQ(StringRef("Bar"), Strings[1]); } |