<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/97024>97024</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [C++20] Itanium name mangling for unevaluated lambda in a local struct does not mangle the function name properly
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          MitalAshok
      </td>
    </tr>
</table>

<pre>
    https://godbolt.org/z/nvfdd11M9

```c++
#include <typeinfo>

template<typename T> struct type_identity { using type = T; };

inline auto f() {
  struct A { using type = decltype([]{}); };
  return A{};
}

inline auto f(int) {
  struct A { using type = decltype([]{}); };
  return A{};
}

using B = decltype(f())::type;
using C = decltype(f(0))::type;

static_assert(!__is_same(B, C));
#if __cpp_lib_constexpr_typeinfo
static_assert(typeid(B) != typeid(C), "not eq at compile time");
#endif

int main() {
 __builtin_printf("%s\n%s\n", typeid(B).name(), typeid(C).name());
 __builtin_printf("eq at runtime? %d\n", typeid(B) == typeid(C));
}

```

The output produced is:

```
N1f1AUlvE_E
N1f1AUlvE_E
eq at runtime? 1
```

When they are clearly different types. For reference, the GCC output is:

```
Z1fvEN1AUlvE_E
Z1fiEN1AUlvE_E
eq at runtime? 0
```

Where `N1f` is replaced with `Z1fvE` or `Z1fiE` depending on the function signature (i.e., the function signature is just not taken into account in the mangling).

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVU2P4zYM_TXKhdjAlvPlQw75mBQ97Jy2KLAXQ7boWLuy5EpUtumvLyQnM5OZZHosYNgQKT4-PlOi8F4dDeKazbdsvp-IQJ1166-KhN74zv6c1Fae1x3R4FmxYfzA-OFoZW01Ta07Mn74h_GDObVS5vnXkmV7lm0u70U2Pg3j2_iMVl4o0-ggEVixo_OAyrSWFU9vQwn7QQvCyw4jeoRvrHgCTy40BNFYKYmGFJ2BLb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