https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103213
Bug ID: 103213 Summary: Lambda type name overlap Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mario.demontis at gmail dot com Target Milestone: --- /******************* BEGIN SOURCE *******************/ template<typename T> struct Wrap{ T w; }; int main() { auto l1 = [x = 5](int a){return x+a;}; auto l2 = [y = 6](int a){return y+1;}; Wrap<decltype(l1)> w1{l1}; Wrap<decltype(l2)> w2{l2}; } /******************** END SOURCE ********************/ Both w1 and w2 are assigned type name Wrap<main()::<lambda(int)> > In gdb there is no way to distinguish between the 2 types: (gdb) ptype 'Wrap<main()::<lambda(int)> >' type = struct Wrap<main()::<lambda(int)> > { struct { int __x; } w; } For the same reason, there is also no way to obtain the 2 different python gdb.Type objects