From 61a0b0b7b93f6d17d0d9ef4503f2abfcc6427f06 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Wed, 20 Nov 2024 00:36:52 -0500 Subject: [PATCH 1/2] Upgrade cxxheaderparser to 1.4.1 --- robotpy_build/autowrap/cxxparser.py | 7 +++++++ setup.cfg | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/robotpy_build/autowrap/cxxparser.py b/robotpy_build/autowrap/cxxparser.py index 83b3891e..ad27ca4c 100644 --- a/robotpy_build/autowrap/cxxparser.py +++ b/robotpy_build/autowrap/cxxparser.py @@ -23,6 +23,7 @@ ClassBlockState, ExternBlockState, NamespaceBlockState, + NonClassBlockState, ) from cxxheaderparser.tokfmt import tokfmt from cxxheaderparser.types import ( @@ -31,6 +32,7 @@ ClassDecl, Concept, DecoratedType, + DeductionGuide, EnumDecl, Field, ForwardDecl, @@ -1272,6 +1274,11 @@ def on_class_end(self, state: AWClassBlockState) -> None: for m in cdata.defer_private_nonvirtual_methods: self._on_class_method_process_overload_only(state, m) + def on_deduction_guide( + self, state: NonClassBlockState, guide: DeductionGuide + ) -> None: + pass + # # Function/method processing # diff --git a/setup.cfg b/setup.cfg index e1d3bd2e..4e3f7390 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,7 +27,7 @@ install_requires = setuptools_scm >= 6.2, < 8 sphinxify >= 0.7.3 pydantic >= 1.7.0, < 2 - cxxheaderparser[pcpp] ~= 1.2 + cxxheaderparser[pcpp] ~= 1.4.1 tomli tomli_w toposort From 6e9f18d5a403a43ddea582b5527320e4f4899030 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Wed, 20 Nov 2024 00:37:17 -0500 Subject: [PATCH 2/2] Don't include constexpr in yml signature - You can't overload based on it so it isn't needed --- robotpy_build/autowrap/generator_data.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/robotpy_build/autowrap/generator_data.py b/robotpy_build/autowrap/generator_data.py index 942aafd5..3100c408 100644 --- a/robotpy_build/autowrap/generator_data.py +++ b/robotpy_build/autowrap/generator_data.py @@ -326,11 +326,13 @@ def _get_function_signature(self, fn: Function) -> str: signature = f"{signature} [const]" else: signature = "[const]" - elif fn.constexpr: - if signature: - signature = f"{signature} [constexpr]" - else: - signature = "[constexpr]" + + # constexpr and non-constexpr cannot be overloaded, so don't include it + # elif fn.constexpr: + # if signature: + # signature = f"{signature} [constexpr]" + # else: + # signature = "[constexpr]" return signature