[Bug libstdc++/104242] [12 Regression] Class with constructor from std::any is not copyable

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 26 19:03:36 GMT 2022


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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note Clang's error message might be more helpfull:
In file included from <source>:2:
In file included from
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/any:39:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/type_traits:168:14:
error: base class has incomplete type
    : public __conditional_t<_B1::value, _B2, _B1>
      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/type_traits:2244:36:
note: in instantiation of template class
'std::__and_<std::__not_<std::integral_constant<bool, false>>,
std::is_copy_constructible<A>>' requested here
    using _Require = __enable_if_t<__and_<_Cond...>::value>;
                                   ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/any:188:19:
note: in instantiation of template type alias '_Require' requested here
              typename = _Require<__not_<__is_in_place_type<_VTp>>,
                         ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/any:190:7:
note: in instantiation of default argument for 'any<const A &, A,
std::any::_Manager_internal<A>>' required here
      any(_Tp&& __value)
      ^~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/type_traits:971:54:
note: while substituting deduced template arguments into function template
'any' [with _Tp = const A &, _VTp = (no value), _Mgr = (no value), $3 = (no
value)]
    : public __bool_constant<__is_constructible(_Tp, _Args...)>
                                                     ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/type_traits:1003:14:
note: in instantiation of template class 'std::__is_constructible_impl<A, const
A &>' requested here
    : public __is_constructible_impl<_Tp, const _Tp&>
             ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/type_traits:1010:14:
note: in instantiation of template class 'std::__is_copy_constructible_impl<A,
true>' requested here
    : public __is_copy_constructible_impl<_Tp>
             ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/type_traits:3205:5:
note: in instantiation of template class 'std::is_copy_constructible<A>'
requested here
    is_copy_constructible<_Tp>::value;
    ^
<source>:9:20: note: in instantiation of variable template specialization
'std::is_copy_constructible_v<A>' requested here
static_assert(std::is_copy_constructible_v<A>);
                   ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.1/../../../../include/c++/12.0.1/type_traits:1009:12:
note: definition of 'std::is_copy_constructible<A>' is not complete until the
closing '}'
    struct is_copy_constructible
           ^


More information about the Gcc-bugs mailing list