Opened 5 weeks ago

Last modified 4 weeks ago

#71090 assigned defect

kicad @7.0.11: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>' — at Version 3

Reported by: mpbb77 (Miguel Branco) Owned by: ra1nb0w
Priority: Normal Milestone:
Component: ports Version: 2.10.2
Keywords: sequoia haspatch Cc:
Port: kicad

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Building Kicad will fail while building thirdparty/nanodbc due to deprecation of std::char_traits<> for types other than char, char8_t, char16_t, char32_t and wchar_t, with errors like:

 .../thirdparty/nanodbc/nanodbc/nanodbc.cpp:261:25: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
    261 |     auto const n = std::char_traits<NANODBC_SQLCHAR>::length(array);
        |                         ^
  /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here
     45 | struct char_traits;
        |        ^
  .../thirdparty/nanodbc/nanodbc/nanodbc.cpp:3576:52: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
   3576 |             dsn.name = string(&name[0], &name[std::char_traits<NANODBC_SQLCHAR>::length(name)]);
        |                                                    ^
  /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here
     45 | struct char_traits;
        |        ^
  .../thirdparty/nanodbc/nanodbc/nanodbc.cpp:3578:49: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
   3578 |                 string(&driver[0], &driver[std::char_traits<NANODBC_SQLCHAR>::length(driver)]);
        |                                                 ^
  /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here
     45 | struct char_traits;
        |        ^
  .../thirdparty/nanodbc/nanodbc/nanodbc.cpp:3629:54: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
   3629 |             drv.name = string(&descr[0], &descr[std::char_traits<NANODBC_SQLCHAR>::length(descr)]);
        |                                                      ^
  /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here
     45 | struct char_traits;
        |        ^

and

  /usr/include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
    820 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
        |                                          ^
  .../thirdparty/compoundfilereader/compoundfilereader.h:226:21: note: in instantiation of template class 'std::basic_string<unsigned short>' requested here
    226 |         utf16string dir;
        |                     ^
  /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
     23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
        |  

The same failure can be found on the freebsd bugzilla @ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281886 and their fix also applies to Macports, as I've applied their patches and the build resumed with no further issues.

Change History (4)

Changed 5 weeks ago by mpbb77 (Miguel Branco)

Attachment: attachment.html added

Patches from FreeBsd Bugzilla readily applicable to this port

comment:1 Changed 5 weeks ago by mpbb77 (Miguel Branco)

Description: modified (diff)

comment:2 Changed 5 weeks ago by mpbb77 (Miguel Branco)

Description: modified (diff)

comment:3 Changed 5 weeks ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: sequoia haspatch added; kicad clang-19 libc++ 19 removed
Owner: set to ra1nb0w
Status: newassigned
Summary: Kicad @7.0.11: fails to build with clang-19 and libc++ 19, after upgrade to macos 15kicad @7.0.11: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
Note: See TracTickets for help on using tickets.