summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-10-25 14:39:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-10-25 17:48:28 +0200
commitd55358c7c31e2e9f124ee90d78eba2db3f1af756 (patch)
treeefe22efde22b39fe18d0b0ce2348b292551a35dd /include
parent4458cf6930fdbda44345fcd1bd9b5c0664cffb9f (diff)
Address a constexpr template point of instantiation issue
...that hits at least when building with Clang and --with-latest-c++ against recent libc++ or MSVC standard library (where C++20 and esp. C++23 made more and more class template member functions constexpr). My understanding is that there is some leeway at what point a compiler should instantiate such function specializations, and Clang decides to instantiate constexpr ones early (cf. <https://github.com/llvm/llvm-project/commit/242ad89a15d5466d166d47978bfff983d40ab511> "C++11 half of r147023: In C++11, additionally eagerly instantiate:" and its "Do not defer instantiations of constexpr functions" comment, and the discussion at <https://discourse.llvm.org/t/point-of-instantiation-of-constexpr-function-template/65129>). > In file included from sw/source/core/access/acccell.cxx:20: > In file included from include/sal/log.hxx:20: > In file included from ~/llvm/inst/bin/../include/c++/v1/sstream:186: > In file included from ~/llvm/inst/bin/../include/c++/v1/istream:165: > In file included from ~/llvm/inst/bin/../include/c++/v1/ostream:168: > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:47:19: error: invalid application of 'sizeof' to an incomplete type 'FndLine_' > static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); > ^~~~~~~~~~~ > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:281:7: note: in instantiation of member function 'std::default_delete<FndLine_>::operator()' requested here > __ptr_.second()(__tmp); > ^ > ~/llvm/inst/bin/../include/c++/v1/__memory/unique_ptr.h:247:75: note: in instantiation of member function 'std::unique_ptr<FndLine_>::reset' requested here > _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); } > ^ > ~/llvm/inst/bin/../include/c++/v1/__memory/construct_at.h:64:13: note: in instantiation of member function 'std::unique_ptr<FndLine_>::~unique_ptr' requested here > __loc->~_Tp(); > ^ > ~/llvm/inst/bin/../include/c++/v1/__memory/construct_at.h:89:12: note: in instantiation of function template specialization 'std::__destroy_at<std::unique_ptr<FndLine_>, 0>' requested here > _VSTD::__destroy_at(__loc); > ^ > ~/llvm/inst/bin/../include/c++/v1/__memory/allocator_traits.h:317:16: note: in instantiation of function template specialization 'std::destroy_at<std::unique_ptr<FndLine_>, 0>' requested here > _VSTD::destroy_at(__p); > ^ > ~/llvm/inst/bin/../include/c++/v1/vector:834:25: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<std::unique_ptr<FndLine_>>>::destroy<std::unique_ptr<FndLine_>, void, void>' requested here > __alloc_traits::destroy(__alloc(), std::__to_address(--__soon_to_be_end)); > ^ > ~/llvm/inst/bin/../include/c++/v1/vector:828:29: note: in instantiation of member function 'std::vector<std::unique_ptr<FndLine_>>::__base_destruct_at_end' requested here > void __clear() _NOEXCEPT {__base_destruct_at_end(this->__begin_);} > ^ > ~/llvm/inst/bin/../include/c++/v1/vector:433:9: note: in instantiation of member function 'std::vector<std::unique_ptr<FndLine_>>::__clear' requested here > __clear(); > ^ > sw/inc/tblsel.hxx:170:5: note: in instantiation of member function 'std::vector<std::unique_ptr<FndLine_>>::~vector' requested here > FndBox_( SwTableBox* pB, FndLine_* pFL ) : > ^ > sw/inc/tblsel.hxx:152:7: note: forward declaration of 'FndLine_' > class FndLine_; > ^ Change-Id: Ia088547c6463a55f48bb4c4ca5107b3bf9472ff1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141820 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions