libstdc++: do not assume std::string can be a constexpr
CStringViewTest fails to build because it initializes a std::string from a literal. libstdc++ implementation fails to do so (it looks like a bug in the implementation, that is expected to allow initialization from literal to be a constexpr). Bug: 40565911 Change-Id: Idf96997a61306f2a0587221868dacc574dede5df Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5658411 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: José Dapena Paz <jdapena@igalia.com> Cr-Commit-Position: refs/heads/main@{#1323433}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
cbb1c105ed
commit
759b2904b6
@ -1061,7 +1061,7 @@ TEST(CStringViewTest, CompatibleWithRanges) {
|
||||
}
|
||||
|
||||
TEST(CStringViewTest, ConstructFromStringLiteralWithEmbeddedNul) {
|
||||
constexpr std::string s = "abc\0de";
|
||||
const std::string s = "abc\0de";
|
||||
constexpr std::string_view sv = "abc\0de";
|
||||
constexpr base::cstring_view cv = "abc\0de";
|
||||
EXPECT_EQ(s, std::string_view("abc"));
|
||||
|
Reference in New Issue
Block a user