Closed Bug 1890905 Opened 11 months ago Closed 11 months ago

Perma [clang-trunk] error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

This error shows up on clang trunk. Ideally it would already appear as a deprecation warning in older versions of clang, but because char_traits is used through basic_string rather than directly, the deprecation warning doesn't happen.
See https://releases.llvm.org/16.0.0/projects/libcxx/docs/ReleaseNotes.html#upcoming-deprecations-and-removals

[task 2024-04-10T22:29:29.667Z] /builds/worker/fetches/sysroot-wasm32-wasi/include/c++/v1/string_view:299:43: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
[task 2024-04-10T22:29:29.667Z]   299 |   static_assert((is_same<_CharT, typename traits_type::char_type>::value),
[task 2024-04-10T22:29:29.667Z]       |                                           ^
[task 2024-04-10T22:29:29.667Z] /builds/worker/checkouts/gecko/js/src/vm/JSONParser.cpp:1185:57: note: in instantiation of template class 'std::basic_string_view<unsigned char>' requested here
[task 2024-04-10T22:29:29.667Z]  1185 |       context(), NewStringCopy<CanGC, CharT>(context(), source));
[task 2024-04-10T22:29:29.667Z]       |                                                         ^
[task 2024-04-10T22:29:29.667Z] /builds/worker/checkouts/gecko/js/src/vm/JSONParser.cpp:1185:18: note: while substituting deduced template arguments into function template 'NewStringCopy' [with allowGC = js::CanGC, CharT = unsigned char]
[task 2024-04-10T22:29:29.668Z]  1185 |       context(), NewStringCopy<CanGC, CharT>(context(), source));
[task 2024-04-10T22:29:29.668Z]       |                  ^
[task 2024-04-10T22:29:29.668Z] /builds/worker/checkouts/gecko/js/src/vm/JSONParser.h:361:12: note: in instantiation of member function 'js::JSONReviveHandler<unsigned char>::finishPrimitiveParseRecord' requested here
[task 2024-04-10T22:29:29.668Z]   361 |     return finishPrimitiveParseRecord(this->v, source);
[task 2024-04-10T22:29:29.668Z]       |            ^
[task 2024-04-10T22:29:29.668Z] /builds/worker/checkouts/gecko/js/src/vm/JSONParser.cpp:331:33: note: in instantiation of function template specialization 'js::JSONReviveHandler<unsigned char>::setStringValue<js::JSONStringType::PropertyName>' requested here
[task 2024-04-10T22:29:29.668Z]   331 |   if (!parser->handler.template setStringValue<ST>(start, length,
[task 2024-04-10T22:29:29.668Z]       |                                 ^
[task 2024-04-10T22:29:29.668Z] /builds/worker/checkouts/gecko/js/src/vm/JSONParser.cpp:381:14: note: in instantiation of function template specialization 'js::JSONTokenizer<unsigned char, js::JSONPerHandlerParser<Latin1Char, js::JSONReviveHandler<Latin1Char>>, js::JSONFullParseHandler<unsigned char>::StringBuilder>::stringToken<js::JSONStringType::PropertyName>' requested here
[task 2024-04-10T22:29:29.668Z]   381 |       return stringToken<ST>(start, length);
[task 2024-04-10T22:29:29.668Z]       |              ^
[task 2024-04-10T22:29:29.668Z] /builds/worker/checkouts/gecko/js/src/vm/JSONParser.cpp:201:12: note: in instantiation of function template specialization 'js::JSONTokenizer<unsigned char, js::JSONPerHandlerParser<Latin1Char, js::JSONReviveHandler<Latin1Char>>, js::JSONFullParseHandler<unsigned char>::StringBuilder>::readString<js::JSONStringType::PropertyName>' requested here
[task 2024-04-10T22:29:29.668Z]   201 |     return readString<JSONStringType::PropertyName>();
[task 2024-04-10T22:29:29.668Z]       |            ^
[task 2024-04-10T22:29:29.668Z] /builds/worker/checkouts/gecko/js/src/vm/JSONParser.cpp:892:27: note: in instantiation of member function 'js::JSONTokenizer<unsigned char, js::JSONPerHandlerParser<Latin1Char, js::JSONReviveHandler<Latin1Char>>, js::JSONFullParseHandler<unsigned char>::StringBuilder>::advancePropertyName' requested here
[task 2024-04-10T22:29:29.668Z]   892 |         token = tokenizer.advancePropertyName();
[task 2024-04-10T22:29:29.668Z]       |                           ^
[task 2024-04-10T22:29:29.668Z] /builds/worker/checkouts/gecko/js/src/vm/JSONParser.cpp:1209:23: note: in instantiation of function template specialization 'js::JSONPerHandlerParser<unsigned char, js::JSONReviveHandler<unsigned char>>::parseImpl<JS::Rooted<JS::Value>, (lambda at /builds/worker/checkouts/gecko/js/src/vm/JSONParser.cpp:1210:18)>' requested here
[task 2024-04-10T22:29:29.668Z]  1209 |   bool result = this->parseImpl(
[task 2024-04-10T22:29:29.668Z]       |                       ^
[task 2024-04-10T22:29:29.669Z] /builds/worker/fetches/sysroot-wasm32-wasi/include/c++/v1/__fwd/string.h:24:29: note: template is declared here
[task 2024-04-10T22:29:29.669Z]    24 | struct _LIBCPP_TEMPLATE_VIS char_traits;
[task 2024-04-10T22:29:29.669Z]       |                             ^
[task 2024-04-10T22:29:29.669Z] 1 error generated.
Type: task → defect
Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/b854f5026b8c Avoid basic_string_view<unsigned char> from ever being picked as a possibility for NewStringCopy. r=spidermonkey-reviewers,dminor
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: