mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-07 16:25:12 +00:00
fix(clang-tidy): Enable clang-tidy else-after-return and redundant void checks (#3080)
* Enable clang-tidy else-after-return and redundant void checks * Fix remaining else-after * Address reviewer comments * Fix indentation * Rerun clang-tidy post merge
This commit is contained in:
@@ -82,7 +82,7 @@ TEST_SUBMODULE(callbacks, m) {
|
||||
// Export the payload constructor statistics for testing purposes:
|
||||
m.def("payload_cstats", &ConstructorStats::get<Payload>);
|
||||
/* Test cleanup of lambda closure */
|
||||
m.def("test_cleanup", []() -> std::function<void(void)> {
|
||||
m.def("test_cleanup", []() -> std::function<void()> {
|
||||
Payload p;
|
||||
|
||||
return [p]() {
|
||||
@@ -108,12 +108,13 @@ TEST_SUBMODULE(callbacks, m) {
|
||||
if (!result) {
|
||||
auto r = f(1);
|
||||
return "can't convert to function pointer: eval(1) = " + std::to_string(r);
|
||||
} else if (*result == dummy_function) {
|
||||
}
|
||||
if (*result == dummy_function) {
|
||||
auto r = (*result)(1);
|
||||
return "matches dummy_function: eval(1) = " + std::to_string(r);
|
||||
} else {
|
||||
return "argument does NOT match dummy_function. This should never happen!";
|
||||
}
|
||||
return "argument does NOT match dummy_function. This should never happen!";
|
||||
|
||||
});
|
||||
|
||||
class AbstractBase {
|
||||
|
||||
Reference in New Issue
Block a user