https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109963
Bug ID: 109963
Summary: ABI: unexpected layout ordering of `this` pointer in
lambda capture
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: joker.eph at gmail dot com
Target Milestone: ---
See the discussion here: https://github.com/itanium-cxx-abi/cxx-abi/issues/141
Most recent post at the moment was calling out a possible implementation bug in
GCC:
> If compilers aren't going to give lambdas internal linkage in these
> situations, the ABI needs to define a layout for them. As far as I can tell,
> Clang, GCC, and ICC are all trying to use the same layout rule: explicit
> captures are added in declaration order, then implicit captures are added in
> the source order of their ODR use in the lambda body. The exception which
> causes this incompatibility is that GCC seems to order implicit this
> arguments (and only implicit ones) after the formal call arguments. I would
> argue that that's just a GCC bug, and the this argument should be ordered as
> if it were written in source. @jicama, do you agree?