Hi gcc-developers and -users,

#include <iostream>
using namespace std;
int main() {

    auto my_lambda = [](auto i) {
        cout << "asdf\n" << i;
    };

    auto my_lambda2 = [](int i) {
        cout << "asdf\n" << i;
    };

    my_lambda(1);
    my_lambda(2.0);
    my_lambda2(3);

    return 0;
}

$ g++ --std=c++14 file.cpp

In this example the mangled names for the lamdbas are:

_ZZ4mainENKUliE0_clEi               <- int
_ZZ4mainENKUlT_E_clIdEEDaS_  <- auto : double
_ZZ4mainENKUlT_E_clIiEEDaS_   <- auto : int

c++filt and libbfd are unable to demangle the last two: (binutils
version 2.26 on Kubuntu 16.04, GCC version: gcc (Ubuntu
5.3.1-14ubuntu2.1) 5.3.1 20160413)

(lambdas with auto parameters is a c++14 feature)

Thanks for your help.
Best regards,
Ronny

Reply via email to