* Removing stray semicolons (discovered by running clang-format v12 followed by tools/check-style.sh). (#3087)

* Manually moving `// NOLINT` comments so that clang-format does not move them to the wrong places.

* Manually reformatting comments related to `static_assert`s so that clang-format does not need two passes.

* Empty lines between #includes, to prevent clang-format from shuffling the order and thereby confusing MSVC 2015.

* git diff -U0 --no-color HEAD^ | python3 $HOME/clone/llvm-project/clang/tools/clang-format/clang-format-diff.py -p1 -style=file -i
This commit is contained in:
Ralf W. Grosse-Kunstleve
2021-07-13 18:14:58 -07:00
committed by GitHub
parent 1be0a0a610
commit aca6c3ba37
8 changed files with 23 additions and 13 deletions

View File

@@ -123,7 +123,7 @@ class NoneCastTester {
public:
int answer = -1;
NoneCastTester() = default;
NoneCastTester(int v) : answer(v) {};
NoneCastTester(int v) : answer(v) {}
};
struct StrIssue {
@@ -390,14 +390,14 @@ TEST_SUBMODULE(methods_and_attributes, m) {
.def("increase_value", &RegisteredDerived::increase_value)
.def_readwrite("rw_value", &RegisteredDerived::rw_value)
.def_readonly("ro_value", &RegisteredDerived::ro_value)
// These should trigger a static_assert if uncommented
//.def_readwrite("fails", &UserType::value) // should trigger a static_assert if uncommented
//.def_readonly("fails", &UserType::value) // should trigger a static_assert if uncommented
// Uncommenting the next line should trigger a static_assert:
// .def_readwrite("fails", &UserType::value)
// Uncommenting the next line should trigger a static_assert:
// .def_readonly("fails", &UserType::value)
.def_property("rw_value_prop", &RegisteredDerived::get_int, &RegisteredDerived::set_int)
.def_property_readonly("ro_value_prop", &RegisteredDerived::get_double)
// This one is in the registered class:
.def("sum", &RegisteredDerived::sum)
;
.def("sum", &RegisteredDerived::sum);
using Adapted = decltype(py::method_adaptor<RegisteredDerived>(&RegisteredDerived::do_nothing));
static_assert(std::is_same<Adapted, void (RegisteredDerived::*)() const>::value, "");