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:
Aaron Gokaslan
2021-07-09 09:45:53 -04:00
committed by GitHub
parent 6d1b197b46
commit b5357d1fa8
17 changed files with 116 additions and 117 deletions

View File

@@ -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 {