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

    <tr>
        <th>Summary</th>
        <td>
            lambda call should propagate as immediate function when the body is immediate-escalating expression
        </td>
    </tr>

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

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

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

<pre>
    
Should clang not generate the lambda call operator for this lambda call? 

According to https://eel.is/c++draft/expr.const#18, `the call operator of a lambda that is not declared with the consteval specifier is an immediate-escalating function` (1) 

>From https://eel.is/c++draft/expr.const#17, the call to f() is an immediate-escalating expression. (2)

(1) and (2) will make the call to `l()` an immediate function and assembly code should not generate assembly code for the call operator. gcc seems to do it

```cpp 
consteval auto f()
{
    return 1; 
}

auto l = [](){
 return f(); 
};


int main()
{
    auto x = l();
}
```

https://godbolt.org/z/vn6fh1fE5
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVO2OsygUvhr8czJGUWr94Y_pdr2BvQIKR2EHwQBOZ_bqN2jbqZP3I3mThho-ng94zuEh6NEidoSdCDtnfInK-U4obsc35aJaPoVa7JhdnPzsSHEmxes_yi1GgjDcjmBdhBEteh4RokIwfLpIDoIbA25O887D4DxEpcPzKql62AC38VUI56W2I0QHKsY5kOqV0J7QHtHkOhDaC0JPhJ6k50NM8x-zz4WzIRJalUdC_wJyKJKKPb0bgN-po-IRdFiFSxSGe5Rw1VGt6lcwfOcGwoxCDxp92swt6GlCqXnEFwyCGx6T0mGxImpnyaEAQo8loe3OU-_d9EdemuTlYSQ6GAg9JvRfiEkIGIJ2Nk9iKKHts5a7Pm7lfRmu2hiY-BvuuMihMBtd8vVM9zC8ovAQcLqYTxBOIoQtFrtA7HdsKfj2ODmMQkBAnELilg503Mk-FNtPzPPtbr8eiS9fV3Pb3py2DwAAj3HxFkpSne7P0pyfwdfzBkh1hq0AblAPkBvCnWKHU512OtdR2wgT1_anklbGj5XRPEC_a7tbfkbep2h08uJMzJ0fCe3_I7R_t4dBlcPfLJNdJduq5Rl2ZVOyltUlazPVHaWom2PJWNWIoUCB7cDYsS5bQak4iCbTHS1oXbCyKSvGWJszOchjXdRYsKE58IbUBU5cm9yY9ylxZzqEBbuWsrrJDL-gCWsnodTiFdZFQmlqLL5LZ14uyxhIXRgdYvhCiToa7J47xy1Ms3czH7ck_SiFV4V2jVRqT6k2flMY2eJN9-0mdVTLJRduIrRPim5_L7N3_6JIpbn6SCW7-vw_AAD__2p-m2Y">