Commit 3fb16ad1 by ObeliskGate Committed by GitHub

fix: using `__cpp_nontype_template_args` instead of…

fix: using `__cpp_nontype_template_args` instead of `__cpp_nontype_template_parameter_class` (#5330)

* fix: use `__cpp_nontype_template_args` instead of gnu extensions

* fix: add feature test value

* fix: change `PYBIND11_TYPING_H_HAS_STRING_LITERAL` skip reason
parent e8f595bb
...@@ -100,9 +100,7 @@ class Never : public none { ...@@ -100,9 +100,7 @@ class Never : public none {
using none::none; using none::none;
}; };
#if defined(__cpp_nontype_template_parameter_class) \ #if defined(__cpp_nontype_template_args) && __cpp_nontype_template_args >= 201911L
&& (/* See #5201 */ !defined(__GNUC__) \
|| (__GNUC__ > 10 || (__GNUC__ == 10 && __GNUC_MINOR__ >= 3)))
# define PYBIND11_TYPING_H_HAS_STRING_LITERAL # define PYBIND11_TYPING_H_HAS_STRING_LITERAL
template <size_t N> template <size_t N>
struct StringLiteral { struct StringLiteral {
......
...@@ -1026,7 +1026,7 @@ def test_optional_object_annotations(doc): ...@@ -1026,7 +1026,7 @@ def test_optional_object_annotations(doc):
@pytest.mark.skipif( @pytest.mark.skipif(
not m.defined_PYBIND11_TYPING_H_HAS_STRING_LITERAL, not m.defined_PYBIND11_TYPING_H_HAS_STRING_LITERAL,
reason="C++20 feature not available.", reason="C++20 non-type template args feature not available.",
) )
def test_literal(doc): def test_literal(doc):
assert ( assert (
...@@ -1037,7 +1037,7 @@ def test_literal(doc): ...@@ -1037,7 +1037,7 @@ def test_literal(doc):
@pytest.mark.skipif( @pytest.mark.skipif(
not m.defined_PYBIND11_TYPING_H_HAS_STRING_LITERAL, not m.defined_PYBIND11_TYPING_H_HAS_STRING_LITERAL,
reason="C++20 feature not available.", reason="C++20 non-type template args feature not available.",
) )
def test_typevar(doc): def test_typevar(doc):
assert ( assert (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment