[cxx-abi-dev] Mangling C++0x Lambdas
Lawrence Crowl
crowl at google.com
Mon Dec 15 20:02:42 UTC 2008
On 12/15/08, Doug Gregor <doug.gregor at gmail.com> wrote:
> On Mon, Dec 15, 2008 at 7:50 AM, David Vandevoorde <daveed at edg.com> wrote:
> > Has anyone on this list already implemented C++0x lambdas and chosen a
> > mangling scheme for them?
>
> The prototype GCC implementation had a mangling scheme, but it won't
> work in the general case.
Why?
> > (We think a mangling convention is needed because they can appear in
> > inline function bodies or determine template argument types.)
>
> Agreed. They can also appear in the initialization of variables at
> namespace scope, e.g.,
>
> struct X {
> template<typename T> X(T);
> };
> X x = [](int x) -> int { return x; }
The semantics here might vary because of the empty capture list.
Let's assume for the moment that we have an "interesting" capture
list, which implies a full-scale constructed type. Does the mangling
of this type need to be part of the ABI? Why isn't a per-compiler
scheme sufficient?
--
Lawrence Crowl
More information about the cxx-abi-dev
mailing list