This repository was archived by the owner on Nov 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +1
-26
lines changed Expand file tree Collapse file tree 1 file changed +1
-26
lines changed Original file line number Diff line number Diff line change @@ -411,29 +411,4 @@ def generate_return_value_policy(func_decl: ast_pb2.FuncDecl) -> str:
411411 if func_decl .return_value_policy == ast_pb2 .FuncDecl .RETURN_AS_BYTES :
412412 return prefix + '_return_as_bytes'
413413 return prefix + 'automatic'
414- return_type = func_decl .returns [0 ]
415- # For smart pointers, it is unnecessary to specify a return value policy in
416- # pybind11.
417- if re .match ('::std::unique_ptr<.*>' , return_type .cpp_exact_type ):
418- return prefix + 'automatic'
419- elif re .match ('::std::shared_ptr<.*>' , return_type .cpp_exact_type ):
420- return prefix + 'automatic'
421- elif return_type .type .cpp_raw_pointer :
422- # Const pointers to uncopyable object are not supported by PyCLIF.
423- if return_type .cpp_exact_type .startswith ('const ' ):
424- return prefix + 'copy'
425- else :
426- return prefix + 'reference'
427- elif return_type .cpp_exact_type .endswith ('&' ):
428- if return_type .cpp_exact_type .startswith ('const ' ):
429- return prefix + 'copy'
430- elif return_type .type .cpp_movable :
431- return prefix + 'move'
432- else :
433- return prefix + 'automatic'
434- else : # Function returns objects directly.
435- if return_type .type .cpp_movable :
436- return prefix + 'move'
437- elif return_type .type .cpp_copyable :
438- return prefix + 'copy'
439- return prefix + 'automatic'
414+ return prefix + '_clif_automatic'
You can’t perform that action at this time.
0 commit comments