FreeBSD Bugzilla – Attachment 252861 Details for
Bug 280893
math/vtk9: fix build with clang and libc++ 19
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
math/vtk9: fix build with clang and libc++ 19
math__vtk9-fix-clang19-build-1.diff (text/plain), 4.24 KB, created by
Dimitry Andric
on 2024-08-17 22:20:31 UTC
(
hide
)
Description:
math/vtk9: fix build with clang and libc++ 19
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2024-08-17 22:20:31 UTC
Size:
4.24 KB
patch
obsolete
>commit 2bdf1f9099cd04a2a5f36f799b71ab9eeee7efe2 >Author: Dimitry Andric <dim@FreeBSD.org> >Date: 2024-08-18T00:19:32+02:00 > > math/vtk9: fix build with clang and libc++ 19 > > As noted in the libc++ 19 release notes [1], std::char_traits<> is now > only provided for char, char8_t, char16_t, char32_t and wchar_t, and any > instantiation for other types will fail. > > This causes math/vtk9 to fail to compile with clang 19 and libc++ 19, > resulting in errors similar to: > > /wrkdirs/usr/ports/math/vtk9/work/VTK-9.2.6/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/fmt/core.h:272:30: error: implicit instantiation of undefined template 'std::char_traits<fmt::char8_t>' > 272 | : data_(s), size_(std::char_traits<Char>::length(s)) {} > | ^ > /wrkdirs/usr/ports/math/vtk9/work/VTK-9.2.6/ThirdParty/diy2/vtkdiy2/include/vtkdiy2/fmt/format.h:487:9: note: in instantiation of member function 'fmt::basic_string_view<fmt::char8_t>::basic_string_view' requested here > 487 | : basic_string_view<char8_t>(reinterpret_cast<const char8_t*>(s)) {} > | ^ > /usr/include/c++/v1/__string/char_traits.h:45:8: note: template is declared here > 45 | struct char_traits; > | ^ > > This is actually a problem in the vendored version of Victor Zverovich's > fmt library [2]. More recent versions of this library have completely > rewritten this part of the header, so work around the issue by making > the basic_string_view<char8_t> part conditional on char8_t being > actually available. (This is only in C++20 and later.) > > Clang 19 now also diagnoses incorrect member accesses, which causes > errors similar to: > > /wrkdirs/usr/ports/math/vtk9/work/VTK-9.2.6/Utilities/octree/octree/octree_node.txx:210:16: error: no member named '_M_chilren' in 'octree_node<T_, d_, A_>'; did you mean 'm_children'? > 210 | return this->_M_chilren[child]; > | ^~~~~~~~~~ > | m_children > /wrkdirs/usr/ports/math/vtk9/work/VTK-9.2.6/Utilities/octree/octree/octree_node.h:37:23: note: 'm_children' declared here > 37 | octree_node_pointer m_children; > | ^ > > This was apparently a typo, and upstream vtk fixed this in > <https://gitlab.kitware.com/vtk/vtk/-/commit/98af50ca33>. Apply that as > a small patch. > > [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals > [2] https://fmt.dev/ > > PR: 280893 > MFH: 2024Q3 > >diff --git a/math/vtk9/files/patch-ThirdParty_diy2_vtkdiy2_include_vtkdiy2_fmt_format.h b/math/vtk9/files/patch-ThirdParty_diy2_vtkdiy2_include_vtkdiy2_fmt_format.h >new file mode 100644 >index 000000000000..eb9c13efbe2f >--- /dev/null >+++ b/math/vtk9/files/patch-ThirdParty_diy2_vtkdiy2_include_vtkdiy2_fmt_format.h >@@ -0,0 +1,18 @@ >+--- ThirdParty/diy2/vtkdiy2/include/vtkdiy2/fmt/format.h.orig 2023-02-15 04:03:53 UTC >++++ ThirdParty/diy2/vtkdiy2/include/vtkdiy2/fmt/format.h >+@@ -480,6 +480,7 @@ void buffer<T>::append(const U* begin, const U* end) { >+ } >+ } // namespace internal >+ >++#ifdef __cpp_char8_t >+ // A UTF-8 string view. >+ class u8string_view : public basic_string_view<char8_t> { >+ public: >+@@ -497,6 +498,7 @@ inline u8string_view operator"" _u(const char* s, std: >+ } >+ } // namespace literals >+ #endif >++#endif // __cpp_char8_t >+ >+ // The number of characters to store in the basic_memory_buffer object itself >+ // to avoid dynamic memory allocation. >diff --git a/math/vtk9/files/patch-Utilities_octree_octree_octree__node.txx b/math/vtk9/files/patch-Utilities_octree_octree_octree__node.txx >new file mode 100644 >index 000000000000..de91955442bb >--- /dev/null >+++ b/math/vtk9/files/patch-Utilities_octree_octree_octree__node.txx >@@ -0,0 +1,11 @@ >+--- Utilities/octree/octree/octree_node.txx.orig 2023-02-15 04:03:53 UTC >++++ Utilities/octree/octree/octree_node.txx >+@@ -207,7 +207,7 @@ const octree_node<T_, d_, A_>& octree_node<T_, d_, A_> >+ { >+ throw std::domain_error("Attempt to access children of an octree leaf node."); >+ } >+- return this->_M_chilren[child]; >++ return this->m_children[child]; >+ } >+ >+ /**\brief Return a reference to a child node.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
yuri
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 280893
: 252861