Repository navigation
compat: build on Apple clang 16 (pre-Tahoe macOS) - #3
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restores build compatibility on pre-Tahoe macOS toolchains (e.g., Xcode 16 / Apple Clang 16) by removing C++23 “deducing this” usage from RaiiHelper, fixing a -Wmismatched-tags warning in the move_only_function fallback, and updating the documented compiler requirement accordingly.
Changes:
- Replaced
RaiiHelper’s explicit object-parameter (“deducing this”) member templates with ref-qualified overloads. - Changed the
move_only_functionforward declaration fromstructtoclassto match the primary template and silence-Wmismatched-tags. - Relaxed the README’s stated macOS/Xcode compiler requirement now that “deducing this” is no longer used.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| move_only_function.h | Aligns forward-declaration tag with the class primary template to avoid -Wmismatched-tags. |
| defer.h | Replaces C++23 explicit object-parameter members in RaiiHelper with portable overload sets compatible with Apple Clang 16. |
| README.md | Updates documented build requirements to match the now-portable C++23 feature usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The RaiiHelper member templates in defer.h used C++23 "deducing this"
(P0847R7) explicit object parameters, which Apple clang only ships in
Xcode 26 / macOS Tahoe. On Xcode 16 / Apple clang 16 the header failed
to parse and broke every translation unit that included it (acl.cc was
the first to fail with cascading errors about void rvalues and acl_t
argument mismatches).
Replace the three deducing-this members of RaiiHelper with traditional
ref-qualified const/non-const overload pairs, preserving semantics:
* operator* -> four overloads (&, const&, &&, const&&)
* operator-> -> &, const& (still returns the wrapped value by
reference, as the original code did)
* addr() -> &, const& returning (const) RaiiHelper*
(no in-tree callers; retained for API parity)
Also change move_only_function's forward declaration from struct to
class so it matches the primary template and stops triggering
-Wmismatched-tags.
Relax the README build requirement from "Xcode 16+ / Apple Clang 18+"
to "Xcode 16 / Apple Clang 16 or newer" now that the code no longer
relies on deducing this.
|
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.



The RaiiHelper member templates in defer.h used C++23 "deducing this" (P0847R7) explicit object parameters, which Apple clang only ships in Xcode 26 / macOS Tahoe. On Xcode 16 / Apple clang 16 the header failed to parse and broke every translation unit that included it (acl.cc was the first to fail with cascading errors about void rvalues and acl_t argument mismatches).
Replace the three deducing-this members of RaiiHelper with traditional ref-qualified const/non-const overload pairs, preserving semantics:
(no in-tree callers; retained for API parity)
Also change move_only_function's forward declaration from struct to class so it matches the primary template and stops triggering -Wmismatched-tags.
Relax the README build requirement from "Xcode 16+ / Apple Clang 18+" to "Xcode 16 / Apple Clang 16 or newer" now that the code no longer relies on deducing this.
Closes #2