Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::char_traits is deprecated in clang 18 and removed in clang 19 #10378

Open
Myoldmopar opened this issue Jan 26, 2024 · 4 comments
Open

std::char_traits is deprecated in clang 18 and removed in clang 19 #10378

Myoldmopar opened this issue Jan 26, 2024 · 4 comments

Comments

@Myoldmopar
Copy link
Member

Some minor deprecation warnings after a system update on @nrel-bot-3. They are here: https://myoldmopar.github.io/EnergyPlusBuildResults/EnergyPlus-0c0cdaa269e7b5939c46b710f4dbdef68db8fdac-x86_64-MacOS-10.18-clang-15.0.0.html. There is a related issue that might be helpful here: jtv/libpqxx#738.

@jmarrec
Copy link
Contributor

jmarrec commented May 29, 2024

Is this still a thing? If so, can I get a link to a log that exists?

@jmarrec
Copy link
Contributor

jmarrec commented Jun 17, 2024

@Myoldmopar Closing for lack of activity. We can reopen if you see them again

@jmarrec jmarrec closed this as completed Jun 17, 2024
@jmarrec
Copy link
Contributor

jmarrec commented Dec 3, 2024

Can't build with clang 19 now that it's fully removed. happens in both fmt and nlohmann json.

In file included from /Users/julien/Software/Others/EnergyPlus/third_party/btwxt/src/regular-grid-interpolator.cpp:5:
In file included from /opt/homebrew/opt/llvm@18/bin/../include/c++/v1/iostream:43:
In file included from /opt/homebrew/opt/llvm@18/bin/../include/c++/v1/ios:223:
In file included from /opt/homebrew/opt/llvm@18/bin/../include/c++/v1/__locale:23:
In file included from /opt/homebrew/opt/llvm@18/bin/../include/c++/v1/string:625:
In file included from /opt/homebrew/opt/llvm@18/bin/../include/c++/v1/string_view:213:
/opt/homebrew/opt/llvm@18/bin/../include/c++/v1/__fwd/string_view.h:22:41: warning: 'char_traits<fmt::detail::char8_type>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 19, so please migrate off of it. [-Wdeprecated-declarations]
   22 | template <class _CharT, class _Traits = char_traits<_CharT> >
      |                                         ^
/Users/julien/Software/Others/EnergyPlus/third_party/fmt-8.0.1/include/fmt/core.h:389:26: note: in instantiation of default argument for 'basic_string_view<fmt::detail::char8_type>' required here
  389 | template <typename Char> using std_string_view = std::basic_string_view<Char>;
      |                          ^~~~~
/Users/julien/Software/Others/EnergyPlus/third_party/fmt-8.0.1/include/fmt/core.h:485:50: note: in instantiation of template type alias 'std_string_view' requested here
  485 |                                       S, detail::std_string_view<Char>>::value)>
      |                                                  ^
/Users/julien/Software/Others/EnergyPlus/third_party/fmt-8.0.1/include/fmt/format.h:562:57: note: in instantiation of template class 'fmt::basic_string_view<fmt::detail::char8_type>' requested here
  562 | inline auto compute_width(basic_string_view<char8_type> s) -> size_t {
      |                                                         ^
/opt/homebrew/opt/llvm@18/bin/../include/c++/v1/__string/char_traits.h:81:8: note: 'char_traits<fmt::detail::char8_type>' has been explicitly marked deprecated here
   81 | struct _LIBCPP_DEPRECATED_(

@jmarrec jmarrec reopened this Dec 3, 2024
@jmarrec jmarrec changed the title New Mac Warnings std::char_traits is deprecated in clang 18 and removed in clang 19 Dec 3, 2024
@jmarrec
Copy link
Contributor

jmarrec commented Dec 3, 2024

LLVM 19:

[ 39%][520/1331] Building CXX object src/EnergyPlus/CMakeFiles/energypluslib.dir/InputProcessing/InputProcessor.cc.o
FAILED: src/EnergyPlus/CMakeFiles/energypluslib.dir/InputProcessing/InputProcessor.cc.o
/opt/homebrew/bin/ccache /opt/homebrew/opt/llvm@19/bin/clang++ -DDEBUG_ARITHM_GCC_OR_CLANG -DEP_cache_GlycolSpecificHeat -DEP_psych_errors -DFMT_LOCALE -DJSON_USE_IMPLICIT_CONVERSIONS=1 -DLINK_WITH_PYTHON -DOBJEXXFCL_ALIGN=64 -DXML_STATIC -I/Users/julien/.pyenv/versions/3.12.2/include/python3.12 -I/Users/julien/Software/Others/EnergyPlus/idd -I/Users/julien/Software/Others/EnergyPlus/third_party/fmt-8.0.1/include -I/Users/julien/Software/Others/EnergyPlus/src -I/Users/julien/Software/Others/EnergyPlus/third_party -I/Users/julien/Software/Others/EnergyPlus/third_party/btwxt/include -I/Users/julien/Software/Others/EnergyPlus/third_party/re2 -I/Users/julien/Software/Others/EnergyPlus/third_party/doj -I/Users/julien/Software/Others/EnergyPlus/third_party/nlohmann -I/Users/julien/Software/Others/EnergyPlus/third_party/fast_float -I/Users/julien/Software/Others/EnergyPlus/third_party/valijson -I/Users/julien/Software/Others/EnergyPlus/third_party/ObjexxFCL/src -I/Users/julien/Software/Others/EnergyPlus/third_party/CLI -I/Users/julien/Software/Others/EnergyPlus/third_party/eigen -I/Users/julien/Software/Others/EnergyPlus/third_party/Windows-CalcEngine/src/Chromogenics/include -I/Users/julien/Software/Others/EnergyPlus/third_party/Windows-CalcEngine/src/Common/include -I/Users/julien/Software/Others/EnergyPlus/third_party/Windows-CalcEngine/src/Gases/include -I/Users/julien/Software/Others/EnergyPlus/third_party/Windows-CalcEngine/src/MultiLayerOptics/include -I/Users/julien/Software/Others/EnergyPlus/third_party/Windows-CalcEngine/src/SingleLayerOptics/include -I/Users/julien/Software/Others/EnergyPlus/third_party/Windows-CalcEngine/src/SpectralAveraging/include -I/Users/julien/Software/Others/EnergyPlus/third_party/Windows-CalcEngine/src/Tarcog/include -I/Users/julien/Software/Others/EnergyPlus/third_party/Windows-CalcEngine/src/Viewer/include -I/Users/julien/Software/Others/EnergyPlus/third_party/ssc -I/Users/julien/Software/Others/EnergyPlus/third_party/penumbra/include -I/Users/julien/Software/Others/EnergyPlus/third_party/kiva/src -I/Users/julien/Software/Others/EnergyPlus-build-clang/third_party/kiva/src/libkiva -I/Users/julien/Software/Others/EnergyPlus/third_party/cpgfunctionEP -I/Users/julien/Software/Others/EnergyPlus/third_party/cpgfunctionEP/include -I/Users/julien/Software/Others/EnergyPlus/third_party/kiva/src/libkiva -I/Users/julien/Software/Others/EnergyPlus/third_party/kiva/vendor/boost-1.77.0 -I/Users/julien/Software/Others/EnergyPlus/third_party/kiva/vendor/eigen -I/Users/julien/Software/Others/EnergyPlus/third_party/btwxt/vendor/courierr/include -I/Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/AirflowNetwork/include -I/Users/julien/Software/Others/EnergyPlus/third_party/ssc/jsoncpp/src/lib_json/../../include -I/Users/julien/Software/Others/EnergyPlus-build-clang/third_party/ssc/jsoncpp/include/json -I/Users/julien/Software/Others/EnergyPlus/third_party/libtk205/include/libtk205 -I/Users/julien/Software/Others/EnergyPlus/third_party/libtk205/vendor/btwxt/include -isystem /Users/julien/Software/Others/EnergyPlus/third_party/SQLite -isystem /Users/julien/Software/Others/EnergyPlus/third_party/Expat -isystem /Users/julien/Software/Others/EnergyPlus/third_party/Expat/lib -isystem /Users/julien/Software/Others/EnergyPlus/third_party/kiva/vendor/boost-1.61.0 -isystem /Users/julien/Software/Others/EnergyPlus/nlohmann -g -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=12.1 -fPIC -DOBJEXXFCL_ARRAY_INIT_DEBUG -pipe -fcolor-diagnostics -Wno-deprecated-declarations -w -fPIC -Wpedantic -Wall -Wextra -Wno-unknown-pragmas -Wno-attributes -Wno-delete-non-virtual-dtor -Wno-missing-braces -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-vexing-parse -Wno-invalid-source-encoding -Winvalid-pch -Xclang -include-pch -Xclang /Users/julien/Software/Others/EnergyPlus-build-clang/src/EnergyPlus/CMakeFiles/energypluslib.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /Users/julien/Software/Others/EnergyPlus-build-clang/src/EnergyPlus/CMakeFiles/energypluslib.dir/cmake_pch.hxx -MD -MT src/EnergyPlus/CMakeFiles/energypluslib.dir/InputProcessing/InputProcessor.cc.o -MF src/EnergyPlus/CMakeFiles/energypluslib.dir/InputProcessing/InputProcessor.cc.o.d -o src/EnergyPlus/CMakeFiles/energypluslib.dir/InputProcessing/InputProcessor.cc.o -c /Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/InputProcessing/InputProcessor.cc
In file included from <built-in>:1:
In file included from /Users/julien/Software/Others/EnergyPlus-build-clang/src/EnergyPlus/CMakeFiles/energypluslib.dir/cmake_pch.hxx:6:
In file included from /Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/DataGlobals.hh:60:
In file included from /Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/IOFiles.hh:62:
In file included from /Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/FileSystem.hh:56:
/Users/julien/Software/Others/EnergyPlus/third_party/nlohmann/json.hpp:5346:19: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
 5346 |     typename std::char_traits<char_type>::int_type get_character()
      |                   ^
/Users/julien/Software/Others/EnergyPlus/third_party/nlohmann/json.hpp:21116:19: note: in instantiation of template class 'nlohmann::detail::iterator_input_adapter<const unsigned char *>' requested here
 21116 |         auto ia = detail::input_adapter(std::forward<InputType>(i));
       |                   ^
/Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/InputProcessing/InputProcessor.cc:111:43: note: in instantiation of function template specialization 'nlohmann::basic_json<>::from_cbor<const gsl::span<const unsigned char>>' requested here
  111 |     static const auto json_schema = json::from_cbor(EmbeddedEpJSONSchema::embeddedEpJSONSchema()); // (AUTO_OK_OBJ)
      |                                           ^
/opt/homebrew/Cellar/llvm/19.1.4/bin/../include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from <built-in>:1:
In file included from /Users/julien/Software/Others/EnergyPlus-build-clang/src/EnergyPlus/CMakeFiles/energypluslib.dir/cmake_pch.hxx:6:
In file included from /Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/DataGlobals.hh:60:
In file included from /Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/IOFiles.hh:62:
In file included from /Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/FileSystem.hh:56:
/Users/julien/Software/Others/EnergyPlus/third_party/nlohmann/json.hpp:8239:41: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
 8239 |     using char_int_type = typename std::char_traits<char_type>::int_type;
      |                                         ^
/Users/julien/Software/Others/EnergyPlus/third_party/nlohmann/json.hpp:21117:26: note: in instantiation of template class 'nlohmann::detail::binary_reader<nlohmann::basic_json<>, nlohmann::detail::iterator_input_adapter<const unsigned char *>>' requested here
 21117 |         const bool res = binary_reader<decltype(ia)>(std::move(ia)).sax_parse(input_format_t::cbor, &sdp, strict, tag_handler);
       |                          ^
/Users/julien/Software/Others/EnergyPlus/src/EnergyPlus/InputProcessing/InputProcessor.cc:111:43: note: in instantiation of function template specialization 'nlohmann::basic_json<>::from_cbor<const gsl::span<const unsigned char>>' requested here
  111 |     static const auto json_schema = json::from_cbor(EmbeddedEpJSONSchema::embeddedEpJSONSchema()); // (AUTO_OK_OBJ)
      |                                           ^
/opt/homebrew/Cellar/llvm/19.1.4/bin/../include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants