]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Simplify constraints for std::any construction [PR104242]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 18 Mar 2022 13:10:01 +0000 (13:10 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 23 Jun 2023 11:53:28 +0000 (12:53 +0100)
commit5fc6b3a03355e1f77a7c38c0fa7afb0822ad954f
treeff019b98ca1c9ab41d9807c63386f6a1bb8ca53b
parent8c150c7618cc76baf0c8bb278f541b327039b160
libstdc++: Simplify constraints for std::any construction [PR104242]

Partially revert r12-4190-g6da36b7d0e43b6f9281c65c19a025d4888a25b2d
because using __and_<..., is_copy_constructible<T>> when T is incomplete
results in an error about deriving from is_copy_constructible<T> when
that is incomplete. I don't know how to fix that, so this simply
restores the previous constraint which worked in this case (even though
I think it's technically undefined to use is_copy_constructible<T> with
incomplete T). This doesn't restore exactly what we had before, but uses
the is_copy_constructible_v and __is_in_place_type_v variable templates
instead of the ::value member.

libstdc++-v3/ChangeLog:

PR libstdc++/104242
* include/std/any (any(T&&)): Revert change to constraints.
* testsuite/20_util/any/cons/104242.cc: New test.

(cherry picked from commit 7a42b1fa1a090ead96cc0f94a8060a9650c810d5)
libstdc++-v3/include/std/any
libstdc++-v3/testsuite/20_util/any/cons/104242.cc [new file with mode: 0644]