Skip to content

Redundant semicolon in the definition of PYBIND11_OVERLOAD_PURE_NAME #2166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ZikangZhou opened this issue Apr 15, 2020 · 0 comments · Fixed by #2325
Closed

Redundant semicolon in the definition of PYBIND11_OVERLOAD_PURE_NAME #2166

ZikangZhou opened this issue Apr 15, 2020 · 0 comments · Fixed by #2325

Comments

@ZikangZhou
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant