https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90220

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Thu May 23 14:49:15 2019
New Revision: 271561

URL: https://gcc.gnu.org/viewcvs?rev=271561&root=gcc&view=rev
Log:
PR libstdc++/90220 Fix any_cast for non-object types

Backport from mainline
2019-04-24  Jonathan Wakely  <jwak...@redhat.com>

        PR libstdc++/90220 (partial)
        * include/std/any (any_cast<T>(any*), any_cast<T>(const any*)): Do
        not attempt ill-formed static_cast to pointers to non-object types.
        * testsuite/20_util/any/misc/any_cast.cc: Test std::any_cast with
        function types.

Backport from mainline
2019-04-24  Jonathan Wakely  <jwak...@redhat.com>

        PR libstdc++/90220
        * include/std/any (__any_caster): Use remove_cv_t instead of decay_t.
        Avoid a runtime check for types that can never be stored in std::any.
        * testsuite/20_util/any/misc/any_cast.cc: Test std::any_cast with
        array types.

Backport from mainline
2019-05-23  Jonathan Wakely  <jwak...@redhat.com>

        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.

Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/include/experimental/any
    branches/gcc-8-branch/libstdc++-v3/include/std/any
    branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/any/misc/any_cast.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc

Reply via email to