aggregates: key the structured backend on P1061, not the 202403L level - #190
Merged
Conversation
g++-15 reports __cpp_structured_bindings=202403L for P0609 (attributes on structured bindings) but does not implement P1061 packs. It therefore passed the guard, selected the structured backend, and failed to compile aggregates.structured.hpp at `auto&& [... members]`. P1061 is 202411L, which is what the backend actually needs. Keying on it sends g++-15 back to the boost.pfr fallback and leaves g++-16 and clang >= 21 on the structured path, unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ux7eanJYt46tkpQhitnk2r
This was referenced Aug 12, 2026
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 aggregate backend guard admits a compiler that cannot compile the backend it selects.
g++-15reports__cpp_structured_bindings=202403L— that is P0609 (attributes on structured bindings), not P1061 (packs). The guard accepts>= 202403L, so g++-15 passes it, selects the structured backend, and then fails:P1061 — the paper the structured backend actually depends on — is
202411L, which only g++-16 reports. The guard's own comments already saygcc < 16/gcc >= 16, so this is just the constant not matching the stated intent.Effect
Verified by preprocessing
AVND_USE_BOOST_PFRagainst each compiler:gnu++23/gnu++26gnu++23gnu++26gnu++23gnu++26gnu++23/gnu++26Only the broken cell changes; clang and g++-16 are unaffected.
Why it matters beyond the hard error
On the pfr fallback, instantiating a large aggregate is very expensive. Compiling a ~336-field object (Kaboom, via score-addon-synthimi) with g++-14 peaks at 40.9 GB RSS and is OOM-killed;
-fsyntax-onlyalone reaches 10 GB, so it is front-end instantiation, not codegen — no optimisation flag affects it. The same TU on g++-16gnu++26, i.e. on the structured backend, compiles in 151 s at 7.1 GB. So which side of this guard a compiler lands on is the difference between building and exhausting memory, and g++-15 currently lands on a third option: neither.