public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109114] New: lambdas should be non-pod for ABI
@ 2023-03-13 19:59 dblaikie at gmail dot com
  0 siblings, 0 replies; only message in thread
From: dblaikie at gmail dot com @ 2023-03-13 19:59 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-13 19:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13 19:59 [Bug c++/109114] New: lambdas should be non-pod for ABI dblaikie at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).