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

    <tr>
        <th>Summary</th>
        <td>
            Use of lambda expression in `noexcept operator` causes `clang` crash
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    I wrote a piece of code for testing purposes:
```cpp
#include <algorithm>
#include <functional>
#include <ranges>

template<typename T>
struct foo
{
 template<typename U>
    constexpr static auto bar(
        const U from,
        const std::type_identity_t<U> to
    )
    {
 return 42;
    }

    template<typename Container, typename U>
 constexpr static auto bar(
        Container& container,
 const U from,
        const std::type_identity_t<U> to,
        const std::size_t count
    )
    noexcept(noexcept(
 std::ranges::generate_n(
 std::back_inserter(container),
                            count,
 [from, to]() noexcept(noexcept(foo::bar(from, to))) { return foo::bar(from, to); }) //
    )) -> void
    {
 std::ranges::generate_n(
 std::back_inserter(container),
                            count,
 [from, to]() noexcept(noexcept(foo::bar(from, to))) { return foo::bar(from, to); });
    }
};

int main() {
 return 0;
}
```

The result of the compilation is shown below (you can also check out the [godbolt link](https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAMzwBtMA7AQwFtMQByARg9KtQYEAysib0QXACx8BBAKoBnTAAUAHpwAMvAFYTStJg1DIApACYAQuYukl9ZATwDKjdAGFUtAK4sGIAGykrgAyeAyYAHI%2BAEaYxCBmAMykAA6oCoRODB7evgGp6ZkCoeFRLLHxSbaY9o4CQgRMxAQ5Pn6BdpgOWQ1NBCWRMXEJyQqNza15HeP9YYPlw0kAlLaoXsTI7BzmiWHI3lgA1CaJbmLAJIQILCfYJhoAgjt7B5jHp1ReDN0CYrf3TySLy8RxObmIhmAmAU/0eAIImBYKQMCLBBAAnilGKw3gAVWEPMb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SV0rDbpPlYqi9oSnaqo/QtQ2YrJB63Wp419ltrFcEcdbRIDMHacHfSs6JBHvZ6oSQHH2%2BqNLIBSCkS0GkuB60tCyMYloeamqjnEGOuSSZFPLlNbjJSHX5wqcXV1tSPX1O9Y3KazT/W1KDR0nu3TVD9wRP0wQI8K7DNjfGiukzF4prmX6xZGbd5UH3kfXNWzL68F2bfYteN5BHPLToRaVb34QM/jc3tjaCGNwUq%2BGtlhGMEGgXEWBPyEH9oBSgoFq7R3zEhQUWdAhV0IrnXihL1CWErqJWumhG74uUNsIS3dRWSXpbJasY9lKz3YZCfSw4LAFAUcOLRvWy0gscs0VLHRPL5bzRGKtBDa0qRbTDhofwesqROOFSAfCd0lW4agy7SJhGtXJJ1Uk/VB9mApAUAgVABBWPms46nW1Nr052tKXnKaQmXU1PbmJr19dJO8Gk4sgN7Su4KcRkp3pKnI1qcGbwTToyMABt09MuIsz16GaWSZszGy83bPzjZ7GEgS340c8/BIrnLnueud/Lz/8fMtueW2gLFhO3dvC327FyDUE5bixQhdqXks5dZwwedWKl0MHRauzLy6%2BHlYXbwjFJXRdc9PcIqrYiatSIrjIq98jgDIClHekWD6n1cp63hgxn7jFqx/aQBec35c4cgyq5bCtYMrQ0GtObkZvE%2BKWlYtaTisNm5CbruaTizC1dpZBtVKxl4ZGcJIIAA%3D%3D))
![image](https://github.com/llvm/llvm-project/assets/52756109/0226eb97-0d38-4a3f-858f-309a518fb959)



</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWEmzokqU_jXUxqgXjAKLu8hkHhUQETcVCaSAjDKI-Os79FbVux2vXg_R275B5IU803eGPHJA41jmLcYfBAcJTv6G5qnohg-7vGA2R_W3pMvWD2OzDN2EN2jTlzjFm-6ySbsMby7dsJnwOJVtvunnoe9GPBIMIEiZIAGxJT-vtO9_7tBM2ab1nOENwUiozruhnIqGYJQ_0S9zm05l16L6XxgG1OYve7-I73XCTV-jCROMNK09blGDN4ffPOM0zOm0uXTdTxkeft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