https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109114

            Bug ID: 109114
           Summary: lambdas should be non-pod for ABI
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dblaikie at gmail dot com
  Target Milestone: ---

See original bug filed against clang:
https://github.com/llvm/llvm-project/issues/59078
itanium-cxx-abi bug: https://github.com/itanium-cxx-abi/cxx-abi/issues/156

(inverted, so it fails with GCC and passes with Clang) example from the clang
bug: https://godbolt.org/z/45TxsPehe
```
template <typename ...T>
struct Callables : T ... {
  Callables(T ...t) : T(t) ... {}
  using T::operator() ...;
};

inline auto f(int x, char y) {
  Callables callables([x, y](void) {}, [y](int) {});
  static_assert(sizeof(callables) == 8);
  return callables;
}

int main(void) { f(0, 1)(42); }
```

Maybe still an open question about lambdas that don't capture - since they do
have a default ctor, but the spec still says they're non-aggregate.

Reply via email to