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

    <tr>
        <th>Summary</th>
        <td>
            Crash in frontend when trying examples of P2564R3 (propagating consteval)
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          loic-joly-sonarsource
      </td>
    </tr>
</table>

<pre>
    Link to compiler explorer reproducer: https://godbolt.org/z/Gnr3bbnej


The following code, extracted from [P2564R3](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2564r3.html) (consteval needs to propagate up), crashed the frontend:
```cpp
static_assert(none_of(
    types,
    []{
 return is_invalid;
    }()
));
```

Excerpt from the call stack: 
```
 #4 0x0000000000b0c48a clang::Sema::MarkExpressionAsImmediateEscalating(clang::Expr*) (.cold) SemaExpr.cpp:0:0
 #5 0x0000000006280f7d clang::Sema::PopExpressionEvaluationContext() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6280f7d)
 #6 0x000000000646e5d2 clang::Sema::BuildLambdaExpr(clang::SourceLocation, clang::SourceLocation, clang::sema::LambdaScopeInfo*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x646e5d2)
 #7 0x0000000006472b61 clang::Sema::ActOnLambdaExpr(clang::SourceLocation, clang::Stmt*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x6472b61)
 #8 0x0000000005d79ed7 clang::Parser::ParseLambdaExpressionAfterIntroducer(clang::LambdaIntroducer&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5d79ed7)
 #9 0x0000000005d7b8ab clang::Parser::ParseLambdaExpression() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5d7b8ab)
#10 0x0000000005d58dcb clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5d58dcb)
#11 0x0000000005d5a76a clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5d5a76a)
```

Additionally, the following similar code, which is supposed to work, does not crash but fails to compile:
```cpp
static_assert(none_of(
    types,
 +[](info i) consteval {
        return is_invalid(i);
 }
));
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVt9v6yYU_mvIC0rk4N8PfkjaZqrWadV63ysMJwktBgS4SfbXT9hOYvd2092WaZYTYzjA933nmHOoc2KnACqUrlF6P6Ot32tbSS3Y_E3L09xpRa3TrWUwqzU_VU9CvWOvMdONERIshqOR2oLFFozVvGVgUbzCe--NQ_EKkQ0im53mtZZ-oe0Okc3viGx-UjauawVvKLpH0Wr8_20PeKul1AehdphpDojcYTh6S5kHjrdWNxil62eSZslvMUrvESmm-x0Oh4U2oObO82HTN8-WiGwcIyQY7Eh445o5RDaGGrChQaJu1ISVbbzY-0YiUmJECqaV8_BBJVYA3AUJjNWG7qgH3BpEygCSWer2wLEPFKxWHhQPoHp2WdTfzJi-x3nqBXulzoH1iBRKK3jVW0SKfhxjjP3JgEPk7trT-wrl66HLgm-twsK9CvVBpeAoXo-s8yBPwNeDCEDLi8UF09gBD0cG1vhe6ECFUSmx85S9B9d-ORMjEic4OkaXq45YUlDMJFW7oEG8eoGG9q1fqH1_OBoLzgmtVu6xaYAL6uHBMSqpF2oXNL9ODcaIrAZnLJiWPLTDimFoESSNV1H3u-BJx3gyUkTbnH-N51mbK5yHDypb6oVWd8GDR9_rh7vHRhuPyOYc_vNz-Ie-sPLc21a9I7KphTr3IbLu7-g4oLi4I8DMJjCTDFJOvoa5boXkT7SpOe0FGUv00n2lT5p10Lto_MFBd9mgX_uFaQOPaquviv974j2vCfF8Sjwndbb8mviK-V_VPyPuG39TGh3KCY1iTCPleQk8H0N4ptZ1h-K5fSUyxP_W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