Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jun 27, 2024
1 parent 0efe146 commit 3fdba88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions include/pybind11/typing.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ class Never : public none {

// Define guard around specific GCC version
// https://github.com/pybind/pybind11/issues/5201
#if defined(__cpp_nontype_template_parameter_class) || define(__GNUG__) && (__GNUC__ >= 10 && __GNUC_MINOR__ < 2)
__gcc_major
template <size_t N>
#if defined(__cpp_nontype_template_parameter_class) \
|| define(__GNUG__) && (__GNUC__ >= 10 && __GNUC_MINOR__ < 2)
__gcc_major template <size_t N>
struct StringLiteral {
constexpr StringLiteral(const char (&str)[N]) { std::copy_n(str, N, name); }
char name[N];
Expand Down Expand Up @@ -225,8 +225,8 @@ struct handle_type_name<typing::Never> {
static constexpr auto name = const_name("Never");
};


#if defined(__cpp_nontype_template_parameter_class) || define(__GNUG__) && (__GNUC__ >= 10 && __GNUC_MINOR__ < 2)
#if defined(__cpp_nontype_template_parameter_class) \
|| define(__GNUG__) && (__GNUC__ >= 10 && __GNUC_MINOR__ < 2)
template <typing::StringLiteral... Literals>
struct handle_type_name<typing::Literal<Literals...>> {
static constexpr auto name = const_name("Literal[")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pytypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@ TEST_SUBMODULE(pytypes, m) {
m.def("annotate_optional_to_object",
[](py::typing::Optional<int> &o) -> py::object { return o; });


#if defined(__cpp_nontype_template_parameter_class) || define(__GNUG__) && (__GNUC__ >= 10 && __GNUC_MINOR__ < 2)
#if defined(__cpp_nontype_template_parameter_class) \
|| define(__GNUG__) && (__GNUC__ >= 10 && __GNUC_MINOR__ < 2)
py::enum_<literals::Color>(m, "Color")
.value("RED", literals::Color::RED)
.value("BLUE", literals::Color::BLUE);
Expand Down

0 comments on commit 3fdba88

Please sign in to comment.