https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111511
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:77cf3773021b0a20d89623e09d620747a05588ec commit r14-4252-g77cf3773021b0a20d89623e09d620747a05588ec Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu Sep 21 09:14:57 2023 +0100 libstdc++: Prevent unwanted ADL in std::to_array [PR111512] As noted in PR c++/111512, GCC does ADL for __builtin_memcpy if it is unqualified, which can cause errors for template argument types which cannot be completed. Casting the memcpy arguments to void* prevents ADL from considering the problem type. libstdc++-v3/ChangeLog: PR libstdc++/111511 PR c++/111512 * include/std/array (to_array): Cast memcpy arguments to void*. * testsuite/23_containers/array/creation/111512.cc: New test.