8000 compat: build on Apple clang 16 (pre-Tahoe macOS) by taoeffect · Pull Request #3 · jwp23/jaim · GitHub
[go: up one dir, main page]

Skip to content

compat: build on Apple clang 16 (pre-Tahoe macOS) - #3

Merged
jwp23 merged 1 commit into
jwp23:masterfrom
taoeffect:taoeffect
Jun 28, 2026
Merged

jwp23 merged 1 commit into
jwp23:masterfrom
taoeffect:taoeffect

Conversation

@taoeffect
Copy link
Copy Markdown

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.

Closes #2

Copilot AI review requested due to automatic review settings April 23, 2026 02:56
Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_function forward declaration from struct to class to 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.
@jwp23
jwp23 merged commit d546a9f into jwp23:master Jun 28, 2026
1 check passed
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doesn't compile on Sequoia

3 participants

0