https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82647
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- FWIW libc++ only accepts this code because <array> includes the whole of <algorithm> which includes <memory> which includes <tuple>. So libc++ also accepts: #include <array> int main() { std::tuple<int, int> t; std::shared_ptr<int> s; } And clearly that isn't valid. Libstdc++ headers try to be more careful about transitive includes, so to use a library feature you need to include the right header.