spidermonkey-115.15.0 fails to compile with clang-18 and libcxx
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: dannftk, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Steps to reproduce:
I set CXX up with clang++-18 and runtime to be libc++ that is delivered along with llvm, then I launched compilation of the engine
Actual results:
Compilation failed
./firefox-115.15.0/js/src/builtin/intl/Locale.cpp:205:20: error: implicit instantiation of undefined template
'std::char_traits<unsigned char>'
205 | iter_ = std::char_traits<CharT>::find(
| ^
./firefox-115.15.0/js/src/builtin/intl/Locale.cpp:766:21: note: in instantiation of member function
'SepKeywordIterator<unsigned char>::next' requested here
766 | beginKey = iter.next();
| ^
./firefox-115.15.0/js/src/builtin/intl/Locale.cpp:805:16: note: in instantiation of function template specialization
'FindUnicodeExtensionType<unsigned char>' requested here
805 | ? FindUnicodeExtensionType(unicodeExtension->latin1Chars(nogc),
| ^
/usr/include/c++/v1/_string/char_traits.h:45:8: note: template is declared here
45 | struct char_traits;
| ^
In file included from Unified_cpp_js_src5.cpp:20:
./firefox-115.15.0/js/src/builtin/intl/Locale.cpp:205:38: error: incomplete definition of type 'std::char_traits<unsigned char>'
205 | iter = std::char_traits<CharT>::find(
| ^
./firefox-115.15.0/js/src/builtin/intl/Locale.cpp:864:31: error: implicit instantiation of undefined template
'std::char_traits<unsigned char>'
864 | if (const CharT* sep = std::char_traits<CharT>::find(baseName, length, '-')) {
| ^
./firefox-115.15.0/js/src/builtin/intl/Locale.cpp:923:16: note: in instantiation of function template specialization
'BaseNameParts<unsigned char>' requested here
923 | ? BaseNameParts(baseName->latin1Chars(nogc), baseName->length())
| ^
/usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here
45 | struct char_traits;
| ^
3 errors generated.
Expected results:
It must compile because C++ does not require std::char_traits<unsigned char> to be implemented within runtime library, it is up to implementation, we cannot rely on it being implemented as a requirement
Could we switch to std::char_traits<char>?
Or is there a version of spidermonkey where it has already been fixed? Maybe some version that is greater than 115.15.0?
Thank you in advance
Comment 1•11 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•11 months ago
|
||
I think this was fixed in bug 1849070.
Updated•11 months ago
|
Description
•