Skip to content

llvm compilation error from non-standard use of std::basic_string / std::char_traits #342

@kesyog

Description

@kesyog

On OSX, I've started encountering llvm compilation errors after updating to 15.4. I believe these are fixed in upstream SFML by:

Newer versions of llvm have started erroring out over usage of std::basic_string with non-char types, which apparently is non-standard but supported until now.

Example error (many are emitted):

  In file included from rust-sfml/SFML/src/SFML/System/String.cpp:28:
  In file included from rust-sfml/SFML/include/SFML/System/String.hpp:32:
  In file included from rust-sfml/SFML/include/SFML/System/Utf.hpp:33:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:205:
  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:24:
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/string:821:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned int>'
    821 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
        |                                          ^
  rust-sfml/SFML/include/SFML/System/String.hpp:52:18: note: in instantiation of template class 'std::basic_string<unsigned int>' requested here
     52 |     typedef std::basic_string<Uint32>::iterator       Iterator;      //!< Iterator type
        |                  ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
     23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
        |                             ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions