[PATCH] D89559: PR47372: Fix Lambda invoker calling conventions

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 11:02:38 PDT 2020


erichkeane added a subscriber: majnemer.
erichkeane added a comment.

Turns out this patch: https://github.com/llvm/llvm-project/commit/2e1e0491b7098fcfe01945e8f62cafe1fcb3cf36 is my problem. The issue has to do deducing a 'local' type in the return type.  As a result, we choose to mangle any type 'containing' auto as 'auto'.

So ours demangles as: ##public: __thiscall `void __cdecl usage(void)'::`1'::<lambda_0>::operator <auto>(void)const ##
MSVC of course demangles as: ##public: __thiscall <lambda_a0787c3cd0f2458bc332f24e9b753a51>::operator double (__cdecl*)(int,float,double)(void)const ##

To me, it seems that the ResultType->getContainedAutoType is perhaps in the wrong here (also of interest, the dyn_cast, for a function that already returns AutoType?)? I'm not sure how to workaround this.  I can of course create an awkward reproducer of this (https://godbolt.org/z/KWPTTh), but I don't have a good idea on how to better handle this.  @majnemer I see you were the initial committer of this, and would like to see if you have any ideas?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89559/new/

https://reviews.llvm.org/D89559



More information about the cfe-commits mailing list