Skip to content

Redundant semicolon in the definition of PYBIND11_OVERLOAD_PURE_NAME #2166

Closed
@ZikangZhou

Description

@ZikangZhou

When using PYBIND11_OVERLOAD_PURE_NAME, like

PYBIND11_OVERLOAD_PURE_NAME(std::string, Animal, "go", Go, n_times);

The compiler gives a warning "Empty statement".
This would not affect the correctness of the programs, but I found that there is a redundant semicolon in the definition of PYBIND11_OVERLOAD_PURE_NAME:

//pybind11.h
#define PYBIND11_OVERLOAD_PURE_NAME(ret_type, cname, name, fn, ...) \
    PYBIND11_OVERLOAD_INT(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, __VA_ARGS__) \
    pybind11::pybind11_fail("Tried to call pure virtual function \"" PYBIND11_STRINGIFY(cname) "::" name "\"");

The semicolon in the last line can be removed.

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