You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// check if all pure-virtual methods could be overridden in Python
617
617
if( C->isAbstract() ) {
618
618
for( auto m = C->method_begin(); m != C->method_end(); ++m ) {
619
+
#if( LLVM_VERSION_MAJOR >= 18 )
620
+
if( m->isPureVirtual() andis_const_overload(*m) ) returnfalse; // it is not clear how to deal with this case since we can't overrdie const versions in Python, - so disabling for now
621
+
#else
619
622
if( m->isPure() andis_const_overload(*m) ) returnfalse; // it is not clear how to deal with this case since we can't overrdie const versions in Python, - so disabling for now
for( auto m = C->method_begin(); m != C->method_end(); ++m ) {
651
+
#if( LLVM_VERSION_MAJOR >= 18 )
652
+
if( m->isPureVirtual() and !isa<CXXConstructorDecl>(*m) and (m->getAccess() == AS_private or !is_bindable(*m) oris_skipping_requested(*m, Config::get())) ) returnfalse;
653
+
#else
647
654
if( m->isPure() and !isa<CXXConstructorDecl>(*m) and (m->getAccess() == AS_private or !is_bindable(*m) oris_skipping_requested(*m, Config::get())) ) returnfalse;
655
+
#endif
648
656
}
649
657
650
658
for( auto b = C->bases_begin(); b != C->bases_end(); ++b ) {
c += indent(fmt::format(call_back_function_body_template, class_name, /*class_qualified_name(C), */ python_name, std::get<1>(args), return_type), "\t\t");
778
+
#if( LLVM_VERSION_MAJOR >= 18 )
779
+
if( m->isPureVirtual() ) c += "\t\tpybind11::pybind11_fail(\"Tried to call pure virtual function \\\"{}::{}\\\"\");\n"_format(C->getNameAsString(), python_name);
780
+
#else
769
781
if( m->isPure() ) c += "\t\tpybind11::pybind11_fail(\"Tried to call pure virtual function \\\"{}::{}\\\"\");\n"_format(C->getNameAsString(), python_name);
782
+
#endif
770
783
else c += "\t\treturn {}::{}({});\n"_format(C->getNameAsString(), m->getNameAsString(), std::get<1>(args));
0 commit comments