From 59572e65598b4b9f2c9ae0b8a0e5fcb6d65c7f92 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 4 Feb 2022 16:34:00 -0800 Subject: [PATCH] ReflowComments: false This has an interesting side-effect on comments for pragmas. Manually tweaked to something that looks ok and is not modified by clang-format anymore. --- .clang-format | 1 + include/pybind11/detail/common.h | 6 +++--- include/pybind11/pytypes.h | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.clang-format b/.clang-format index 0479078dbb..9b17129ce6 100644 --- a/.clang-format +++ b/.clang-format @@ -14,6 +14,7 @@ IndentCaseLabels: true IndentPPDirectives: AfterHash IndentWidth: 4 Language: Cpp +ReflowComments: false SpaceAfterCStyleCast: true Standard: Cpp11 TabWidth: 4 diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index ab2fbcf5ef..62e6a2bfcc 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -956,9 +956,9 @@ PYBIND11_NAMESPACE_END(detail) #if defined(_MSC_VER) # pragma warning(push) -# pragma warning( \ - disable : 4275) // warning C4275: An exported class was derived from a class that wasn't - // exported. Can be ignored when derived from a STL class. +# pragma warning(disable : 4275) +// warning C4275: An exported class was derived from a class that wasn't exported. +// Can be ignored when derived from a STL class. #endif /// C++ bindings of builtin Python exceptions class PYBIND11_EXPORT_EXCEPTION builtin_exception : public std::runtime_error { diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 0541ed4ac7..f9ab75eba9 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -367,9 +367,9 @@ PYBIND11_NAMESPACE_END(detail) #if defined(_MSC_VER) # pragma warning(push) -# pragma warning( \ - disable : 4275 4251) // warning C4275: An exported class was derived from a class that - // wasn't exported. Can be ignored when derived from a STL class. +# pragma warning(disable : 4275 4251) +// warning C4275: An exported class was derived from a class that wasn't exported. +// Can be ignored when derived from a STL class. #endif /// Fetch and hold an error which was already set in Python. An instance of this is typically /// thrown to propagate python-side errors back through C++ which can either be caught manually or