Skip to content

fix(app): capture the member, not the structured binding, for AppleClang 15 - #229

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
228-appleclang15-structured-binding
Oct 16, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
228-appleclang15-structured-binding

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Fixes #228

Problem

v0.23.0 does not build with AppleClang 15 (Xcode 15.4), the default compiler of the macos-14 runner on which CoreTrace builds the analyzer. CoreTrace's CI fails there on its update to v0.23.0 (CoreTrace/coretrace#194). src/app/AnalyzerApp.cpp:1090 captures the structured binding wrapper in a lambda, which AppleClang only supports from version 16. This CI builds on macos-latest, whose AppleClang is newer, so it could not see the problem.

Change

  1. 8dc8830 (ci): build on macos-14 too. That job builds with AppleClang 15, so the next capture of this kind fails here instead of in CoreTrace. The steps specific to Linux (self-analysis, Code Scanning) do not run on it.
  2. 0b1cae7 (fix(app)): capture the member. The lambda captures wrapper.pairs through an init-capture, [&pairs = wrapper.pairs]. The predicate is the same.

Validation

  • Compiling the 51 translation units of v0.23.0 with -Wpre-c++20-compat reports one captured structured binding, at AnalyzerApp.cpp:1090. With the fix, it reports none.
  • With the fix, the file compiles without warnings with LLVM 20 headers and AppleClang 17 on macOS, and clang-format 20 leaves it unchanged.
  • AppleClang 15 itself is only checked by the new macos-14 job: I have no such compiler locally.

CoreTrace needs a release with this fix (v0.23.1) for CoreTrace/coretrace#169.

…eTrace uses

CoreTrace builds the analyzer on macos-14 with AppleClang 15 (Xcode 15.4). macos-latest has a newer AppleClang, so C++20 features that AppleClang 15 lacks pass here and fail there, as the structured binding captured in AnalyzerApp.cpp did in v0.23.0.

Refs #228
…ang 15

AppleClang 15 cannot capture a structured binding in a lambda, a C++20 feature it supports from version 16, so v0.23.0 does not build on macos-14. The predicate now captures wrapper.pairs through an init-capture; it is the same predicate.

Closes #228
@SizzleUnrlsd SizzleUnrlsd added the bug Something isn't working label Oct 15, 2026
@SizzleUnrlsd SizzleUnrlsd self-assigned this Oct 15, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit d1d9271 into main Oct 16, 2026
15 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the 228-appleclang15-structured-binding branch October 16, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.23.0 does not build with AppleClang 15: a lambda captures a structured binding

1 participant