diff --git a/.clang-tidy b/.clang-tidy index 3079b3b3c..9098e77ff 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,12 +2,17 @@ FormatStyle: file Checks: ' llvm-namespace-comment, -modernize-use-override, -readability-container-size-empty, -modernize-use-using, -modernize-use-equals-default, +modernize-avoid-bind, +modernize-replace-auto-ptr, +modernize-replace-disallow-copy-and-assign-macro, +modernize-shrink-to-fit, modernize-use-auto, +modernize-use-equals-default, +modernize-use-equals-delete, modernize-use-emplace, +modernize-use-override, +modernize-use-using, +readability-container-size-empty, ' CheckOptions: @@ -15,3 +20,5 @@ CheckOptions: value: 'exception_ptr$;' HeaderFilterRegex: 'pybind11/.*h' + +WarningsAsErrors: '*' diff --git a/tests/test_factory_constructors.cpp b/tests/test_factory_constructors.cpp index 7ff7e7b52..6832ac494 100644 --- a/tests/test_factory_constructors.cpp +++ b/tests/test_factory_constructors.cpp @@ -20,12 +20,12 @@ class TestFactory1 { TestFactory1() : value("(empty)") { print_default_created(this); } TestFactory1(int v) : value(std::to_string(v)) { print_created(this, value); } TestFactory1(std::string v) : value(std::move(v)) { print_created(this, value); } +public: + std::string value; TestFactory1(TestFactory1 &&) = delete; TestFactory1(const TestFactory1 &) = delete; TestFactory1 &operator=(TestFactory1 &&) = delete; TestFactory1 &operator=(const TestFactory1 &) = delete; -public: - std::string value; ~TestFactory1() { print_destroyed(this); } }; // Non-public construction, but moveable: