File tree Expand file tree Collapse file tree 4 files changed +36
-3
lines changed Expand file tree Collapse file tree 4 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -1099,6 +1099,11 @@ Bug Fixes to C++ Support
1099
1099
- Fix incorrect code generation caused by the object argument of ``static operator() `` and ``static operator[] `` calls not being evaluated.
1100
1100
Fixes (`#67976 <https://github.com/llvm/llvm-project/issues/67976 >`_)
1101
1101
1102
+ - Fix crash when using an immediate-escalated function at global scope.
1103
+ (`#82258 <https://github.com/llvm/llvm-project/issues/82258 >`_)
1104
+ - Correctly immediate-escalate lambda conversion functions.
1105
+ (`#82258 <https://github.com/llvm/llvm-project/issues/82258 >`_)
1106
+
1102
1107
Bug Fixes to AST Handling
1103
1108
^^^^^^^^^^^^^^^^^^^^^^^^^
1104
1109
- Fixed an import failure of recursive friend class template.
Original file line number Diff line number Diff line change @@ -1090,7 +1090,9 @@ class Sema final {
1090
1090
if (FD) {
1091
1091
FD->setWillHaveBody(true);
1092
1092
S.ExprEvalContexts.back().InImmediateFunctionContext =
1093
- FD->isImmediateFunction();
1093
+ FD->isImmediateFunction() ||
1094
+ S.ExprEvalContexts[S.ExprEvalContexts.size() - 2]
1095
+ .isConstantEvaluated();
1094
1096
S.ExprEvalContexts.back().InImmediateEscalatingFunctionContext =
1095
1097
S.getLangOpts().CPlusPlus20 && FD->isImmediateEscalating();
1096
1098
} else
Original file line number Diff line number Diff line change @@ -18294,7 +18294,6 @@ void Sema::CheckUnusedVolatileAssignment(Expr *E) {
18294
18294
}
18295
18295
18296
18296
void Sema::MarkExpressionAsImmediateEscalating(Expr *E) {
18297
- assert(!FunctionScopes.empty() && "Expected a function scope");
18298
18297
assert(getLangOpts().CPlusPlus20 &&
18299
18298
ExprEvalContexts.back().InImmediateEscalatingFunctionContext &&
18300
18299
"Cannot mark an immediate escalating expression outside of an "
@@ -18311,7 +18310,8 @@ void Sema::MarkExpressionAsImmediateEscalating(Expr *E) {
18311
18310
} else {
18312
18311
assert(false && "expected an immediately escalating expression");
18313
18312
}
18314
- getCurFunction()->FoundImmediateEscalatingExpression = true;
18313
+ if (FunctionScopeInfo *FI = getCurFunction())
18314
+ FI->FoundImmediateEscalatingExpression = true;
18315
18315
}
18316
18316
18317
18317
ExprResult Sema::CheckForImmediateInvocation(ExprResult E, FunctionDecl *Decl) {
Original file line number Diff line number Diff line change @@ -368,3 +368,29 @@ vector<void> v{};
368
368
// expected-note@-2 {{in call to 'vector()'}}
369
369
370
370
}
371
+
372
+
373
+ namespace GH82258 {
374
+
375
+ template <class R , class Pred >
376
+ constexpr auto none_of (R&& r, Pred pred) -> bool { return true ; }
377
+
378
+ struct info { int value; };
379
+ consteval auto is_invalid (info i) -> bool { return false ; }
380
+ constexpr info types[] = { {1 }, {3 }, {5 }};
381
+
382
+ static_assert (none_of(
383
+ types,
384
+ +[](info i) consteval {
385
+ return is_invalid (i);
386
+ }
387
+ ));
388
+
389
+ static_assert (none_of(
390
+ types,
391
+ []{
392
+ return is_invalid;
393
+ }()
394
+ ));
395
+
396
+ }
You can’t perform that action at this time.
0 commit comments