diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h index cd91d152f6400a6b177cea1ca46da1091d7dbf0c..182c3e23eedacf01355a9647877276a7bc95e00e 100644 --- a/libstdc++-v3/include/bits/alloc_traits.h +++ b/libstdc++-v3/include/bits/alloc_traits.h @@ -944,7 +944,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Destroy(_ForwardIterator __first, _ForwardIterator __last, allocator<_Tp>&) { - _Destroy(__first, __last); + std::_Destroy(__first, __last); } #endif /// @endcond diff --git a/libstdc++-v3/include/bits/stl_construct.h b/libstdc++-v3/include/bits/stl_construct.h index 574f4fa50b4c58ea70a734c0ad75d5b7ac5861c0..cf62d927cdb780bde22cecc6f28e7d9cbd5a4f79 100644 --- a/libstdc++-v3/include/bits/stl_construct.h +++ b/libstdc++-v3/include/bits/stl_construct.h @@ -190,7 +190,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif #if __cplusplus >= 202002L if (std::__is_constant_evaluated()) - return _Destroy_aux<false>::__destroy(__first, __last); + return std::_Destroy_aux<false>::__destroy(__first, __last); #endif std::_Destroy_aux<__has_trivial_destructor(_Value_type)>:: __destroy(__first, __last); @@ -239,7 +239,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif #if __cplusplus >= 202002L if (std::__is_constant_evaluated()) - return _Destroy_n_aux<false>::__destroy_n(__first, __count); + return std::_Destroy_n_aux<false>::__destroy_n(__first, __count); #endif return std::_Destroy_n_aux<__has_trivial_destructor(_Value_type)>:: __destroy_n(__first, __count); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destroy-adl.cc b/libstdc++-v3/testsuite/23_containers/vector/cons/destroy-adl.cc new file mode 100644 index 0000000000000000000000000000000000000000..5623842e9b195f3fd7f1670793d50f8399c0a713 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/cons/destroy-adl.cc @@ -0,0 +1,11 @@ +// { dg-do compile } + +#include <vector> + +template<class T> struct Holder { T t; }; // { dg-bogus "incomplete type" } +struct Incomplete; + +void destroy(std::vector<Holder<Incomplete>*>* p) +{ + p->~vector(); +}