Repository navigation
fix assert ambiguity: use direct bool condition instead of lambda - #194
Closed
igagis-bot wants to merge 1 commit into
Closed
igagis-bot wants to merge 1 commit into
igagis-bot wants to merge 1 commit into
Conversation
Apple clang (Xcode 26.6) reports the lambda form of utki::assert() with a by-value local capture as an ambiguous call between the bool and the std::function<bool()> overloads. Pass the condition directly as a bool expression to avoid the ambiguity.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #194 +/- ##
=======================================
Coverage 28.53% 28.54%
=======================================
Files 239 239
Lines 8943 8940 -3
Branches 2785 2785
=======================================
Hits 2552 2552
+ Misses 6057 6054 -3
Partials 334 334 ☔ View full report in Codecov by Harness. |
Contributor
Author
|
Superseded by the root-cause fix in cppfw/utki#33 (SFINAE-constrains the bool-taking assert() overloads in the header). This call-site fix only covers this one file, and turns the lazy condition into an eagerly-evaluated expression (behavior change in release builds). |
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.
Apple clang (Xcode 26.6) fails to resolve the overloaded call
in tiling_area.cpp (on_lay_out()), reporting "call to 'assert' is
ambiguous" between the bool and std::function<bool()> overloads.
Pass the condition directly as a bool expression so the call is
unambiguously the bool overload on every compiler. Behavior is
unchanged; the condition is still only enforced in debug builds.