Skip to content

operator= in Wrapped.hpp produces deprecated warnings #1995

@ghuser404

Description

@ghuser404

Godot version

4.6.3-stable

godot-cpp version

10.0.0-rc1

System information

Windows 11

Issue description

The assignment operator void operator=(const m_class &p_rval) {} in GDEXTENSION_CLASS_ALIAS, which is used to create Godot classes, produces deprecated warnings in MinGW. For devs using -Werror this fails the build.

error: implicitly-declared 'constexpr godot::SpriteFrames::SpriteFrames(const godot::SpriteFrames&)' is deprecated [-Werror=deprecated-copy]

I know it's strange, because I'm not really trying to copy godot::SpriteFrames, but rather this error comes from some reflection magic.

The fix it very simple, since the function is private and is defined as {}, marking it = delete; fixes the warning.

void operator=(const m_class &p_rval) = delete;

Steps to reproduce

N/A

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions