https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97564
Bug ID: 97564
Summary: [11.0 regression] pybind11 compilation failure
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Created attachment 49439
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49439&action=edit
preprocessed test case
The attached testcase was distilled from glue code using Pybind11. It is
compiled without complaint by older g++ versions, but the development version
rejects it with:
artin@debian:~/codes/ducc$ g++ -c test.i -std=c++17 -Wfatal-errors
In file included from
/usr/lib/python3/dist-packages/pybind11/include/pybind11/attr.h:13,
from
/usr/lib/python3/dist-packages/pybind11/include/pybind11/pybind11.h:44,
from test.cc:1:
/usr/lib/python3/dist-packages/pybind11/include/pybind11/cast.h: In
instantiation of ‘typename
pybind11::detail::make_caster<T>::cast_op_type<typename
std::add_rvalue_reference<_Tp>::type>
pybind11::detail::cast_op(pybind11::detail::make_caster<T>&&) [with T =
std::__cxx11::basic_string<char>; typename
pybind11::detail::make_caster<T>::cast_op_type<typename
std::add_rvalue_reference<_Tp>::type> = std::__cxx11::basic_string<char>&&;
pybind11::detail::make_caster<T> =
pybind11::detail::type_caster<std::__cxx11::basic_string<char>, void>; typename
std::add_rvalue_reference<_Tp>::type = std::__cxx11::basic_string<char>&&]’:
/usr/lib/python3/dist-packages/pybind11/include/pybind11/cast.h:1707:22:
required from ‘T pybind11::cast(const pybind11::handle&) [with T =
std::__cxx11::basic_string<char>; typename std::enable_if<(!
std::is_base_of<pybind11::detail::pyobject_tag, typename
std::remove_reference<_Tp>::type>::value), int>::type <anonymous> = 0]’
/usr/lib/python3/dist-packages/pybind11/include/pybind11/cast.h:1725:72:
required from ‘T pybind11::handle::cast() const [with T =
std::__cxx11::basic_string<char>]’
/usr/lib/python3/dist-packages/pybind11/include/pybind11/cast.h:446:77:
required from here
/usr/lib/python3/dist-packages/pybind11/include/pybind11/cast.h:950:43: error:
no type named ‘make_caster’ in
‘std::remove_reference<pybind11::detail::type_caster<std::__cxx11::basic_string<char>,
void>&>::type’ {aka ‘class
pybind11::detail::type_caster<std::__cxx11::basic_string<char>, void>’}
949 | return std::move(caster).operator
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
950 | typename make_caster<T>::template cast_op_type<typename
std::add_rvalue_reference<T>::type>();
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.