这是indexloc提供的服务,不要输入任何密码
Skip to content

Blacklist specific methods from a class #1485

@0xddom

Description

@0xddom

Is there a way to control what methods and constructors are generated for a given class? I cannot build a set of bindings I'm working on because they have a third-party C++ class that is similar to the following class.

class Foo {
  std::unique_ptr<Bar> bar;

public:
  Foo(const Foo &) = default;
};

The original codebase does not use that copy constructor so it just gets DCEd without having to generate its implementation but autocxx generates code that calls it, failing to compile.

This is an example of what kind of autogenerated function is calling this incorrect copy ctor.

cargo:warning=  185 | inline void mlir_StorageUniquer_new_synthetic_const_copy_ctor_0x58d3a59253fcf097_autocxx_wrapper_0x58d3a59253fcf097(mlir::StorageUniquer* autocxx_gen_this, const mlir::StorageUniquer& arg1)  { new (autocxx_gen_this) mlir::StorageUniquer(arg1); }

I would like to blacklist these problematic methods and constructors. Is that supported? I went through the documentation but I couldn't find anything that sounded similar.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions