Add char8_t string overloads to MFBT string functions when compiling with -std=c++20
Categories
(Core :: MFBT, task, P3)
Tracking
()
People
(Reporter: cpeterson, Assigned: cpeterson)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
When compiled with -std=c++17, u8""
string literals have type const char[]
. When compiled with -std=c++20, u8""
string literals have type const char8_t[]
. This patch adds the minimum char8_t overloads needed to compile Firefox with -std=c++20. If we want to use char8_t in more code or replace Utf8Unit
with char8_t
, that will require an extensive redesign of MFBT's and xpcom's string classes after we update from -std=c++17 to c++20.
obj-aarch64-unknown-linux-android/dist/include/mozilla/Utf8.h:473:20: error: call to constructor of 'const Utf8Unit' is ambiguous
| const Utf8Unit unit(*(*aIter)++);
mfbt/tests/TestUtf8.cpp:52:25: error: call to 'IsAscii' is ambiguous
| MOZ_RELEASE_ASSERT(!IsAscii(aStart[0]));
xpcom/tests/gtest/TestStrings.cpp:1446:17: error: no matching member function for call to 'Equals'
| EXPECT_TRUE(s.Equals(u8"\uFFFD"));
Assignee | ||
Comment 1•9 months ago
|
||
When compiled with -std=c++17, u8"" string literals have type const char[]
. When compiled with -std=c++20, u8"" string literals have type const char8_t[]
. This patch adds the minimum char8_t overloads needed to compile Firefox with -std=c++20. If we want to use char8_t in more code or replace Utf8Unit
with char8_t, that will require an extensive redesign of MFBT's and xpcom's string classes after we update from -std=c++17 to c++20.
Comment 3•9 months ago
|
||
bugherder |
Description
•