Skip to content

Commit

Permalink
Merge pull request #237 from robotpy/upgrades-and-remove-constexpr
Browse files Browse the repository at this point in the history
Upgrades and remove constexpr from signature
  • Loading branch information
virtuald authored Nov 20, 2024
2 parents 106e39d + 6e9f18d commit 77fce67
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 7 additions & 0 deletions robotpy_build/autowrap/cxxparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ClassBlockState,
ExternBlockState,
NamespaceBlockState,
NonClassBlockState,
)
from cxxheaderparser.tokfmt import tokfmt
from cxxheaderparser.types import (
Expand All @@ -31,6 +32,7 @@
ClassDecl,
Concept,
DecoratedType,
DeductionGuide,
EnumDecl,
Field,
ForwardDecl,
Expand Down Expand Up @@ -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
#
Expand Down
12 changes: 7 additions & 5 deletions robotpy_build/autowrap/generator_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 77fce67

Please sign in to comment.