Skip to content

codecvt_utf8 removed in C++26 #1098

@jmarrec

Description

@jmarrec

/** <codecvt> availability */
#if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 5
#define CLI11_HAS_CODECVT 0
#else
#define CLI11_HAS_CODECVT 1
#include <codecvt>
#endif

Using llvm 19, in C++26 mode, can't compile

In file included from /Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/CLI.hpp:18:
In file included from /Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/Encoding.hpp:54:
/Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/impl/Encoding_inl.hpp:68:17: error: no member named 'wstring_convert' in namespace 'std'
   68 |     return std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes(str, str + str_size);
      |            ~~~~~^
/Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/impl/Encoding_inl.hpp:68:38: error: no member named 'codecvt_utf8' in namespace 'std'
   68 |     return std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes(str, str + str_size);
      |                                 ~~~~~^
/Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/impl/Encoding_inl.hpp:68:58: error: expected '(' for function-style cast or type construction
   68 |     return std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes(str, str + str_size);
      |                                                   ~~~~~~~^
/Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/impl/Encoding_inl.hpp:68:61: error: expected expression
   68 |     return std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes(str, str + str_size);
      |                                                             ^
/Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/impl/Encoding_inl.hpp:99:17: error: no member named 'wstring_convert' in namespace 'std'
   99 |     return std::wstring_convert<std::codecvt_utf8<wchar_t>>().from_bytes(str, str + str_size);
      |            ~~~~~^
/Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/impl/Encoding_inl.hpp:99:38: error: no member named 'codecvt_utf8' in namespace 'std'
   99 |     return std::wstring_convert<std::codecvt_utf8<wchar_t>>().from_bytes(str, str + str_size);
      |                                 ~~~~~^
/Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/impl/Encoding_inl.hpp:99:58: error: expected '(' for function-style cast or type construction
   99 |     return std::wstring_convert<std::codecvt_utf8<wchar_t>>().from_bytes(str, str + str_size);
      |                                                   ~~~~~~~^
/Users/julien/.conan2/p/cli1176dd194db6a54/p/include/CLI/impl/Encoding_inl.hpp:99:61: error: expected expression
   99 |     return std::wstring_convert<std::codecvt_utf8<wchar_t>>().from_bytes(str, str + str_size);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions