fix: resolve -Wshadow warnings in sml.hpp (issue #496)#676
Merged
kris-jusiak merged 3 commits intoMay 24, 2026
Conversation
Several declarations in sml.hpp shadow class members or enclosing-scope names, causing -Wshadow/-Werror failures in user projects. Changes: - pool_type_impl<T&>: rename ctor params 'value' -> 'val' (avoid shadowing the T& value member) - zero_wrapper specializations (6): rename ctor param 'ptr' -> 'fn_ptr' - queue_event_call: rename ctor param 'call' -> 'call_fn' - exception: rename ctor param 'exception' -> 'ex' - sm_impl methods (22): rename param 'deps' -> 'd'; the type alias 'using deps = ...' is kept because merge_deps accesses ::deps on sm_impl sub-machine types - sm: rename 'using deps = ...' -> 'using dep_list = ...' (not accessed externally; sm types are not in sub_sms_t), update the one internal use in deps_t - sm::set_current_states: rename local var 'sm' -> 'sm_impl_ref' - process_impl: rename ctor param 'event' -> 'ev' - front::transition ctors (8): rename ctor params 'g'/'a' -> 'g_init'/'a_init' - front::transition execute methods (11 overloads): rename params 'event' -> 'ev', 'deps' -> 'd' (these shadow 'using event = E' and 'using deps = ...' type aliases in the same struct) All existing tests pass with -Wall -Wextra -Werror -pedantic.
Contributor
Author
|
May be we should update make a release and update documentation after I'm done with all this. |
Collaborator
|
👍 for release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #496.
Several declarations shadow class members or type aliases, breaking
-Wshadow -Werrorbuilds.Changes:
pool_type_impl<T&>ctors: paramvalue→val(shadowedT& valuemember)zero_wrapperctors (×6): paramptr→fn_ptrqueue_event_callctor: paramcall→call_fnexceptionctor: paramexception→exsm_implmethods (×22): paramTDeps &deps→TDeps &d; aliasusing deps = ...kept becausemerge_depsaccessessm_impl::depsfor sub-machine dep collectionsm:using deps = ...→using dep_list = ...(safe; sm types not passed tomerge_deps)sm::set_current_states: localsm→sm_impl_refprocess_implctor: paramevent→evfront::transitionctors (×8): paramsg/a→g_init/a_initfront::transitionexecute methods (×11): paramsevent/deps→ev/d; type aliases kept (accessed externally viatransitional_implandmerge_deps)All tests pass. Zero
-Wshadowwarnings compiling everytest/ft/*.cppwith-Wshadow -Werror.