]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/ChangeLog
PR libstdc++/90220 fix experimental::any_cast for non-object types
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 May 2019 13:39:06 +0000 (13:39 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 May 2019 13:39:06 +0000 (13:39 +0000)
commit1db1e5ccca0d962558987bd1d87537e99f60e859
tree379706dbe804d09b85f9a9d365338c25b800ec30
parentaeb3544557033b3155b0b85547b99b3a8dd343dc
PR libstdc++/90220 fix experimental::any_cast for non-object types

This corresponds to the fixes done for std::any_cast, but has to be done
without if-constexpr. The dummy specialization of _Manager_internal<_Op>
is used to avoid instantiating the real _Manager_internal<T>::_S_manage
function just to compare its address.

PR libstdc++/90220
* include/experimental/any (__any_caster): Constrain to only be
callable for object types. Use remove_cv_t instead of decay_t.
If the type decays or isn't copy constructible, compare the manager
function to a dummy specialization.
(__any_caster): Add overload constrained for non-object types.
(any::_Manager_internal<_Op>): Add dummy specialization.
* testsuite/experimental/any/misc/any_cast.cc: Test function types
and array types.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271556 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/any
libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc