File tree 4 files changed +35
-3
lines changed
4 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -297,6 +297,10 @@ Bug Fixes to C++ Support
297
297
was only accepted at namespace scope but not at local function scope.
298
298
- Clang no longer tries to call consteval constructors at runtime when they appear in a member initializer.
299
299
(`#782154 <https://github.com/llvm/llvm-project/issues/82154>`_`)
300
+ - Fix crash when using an immediate-escalated function at global scope.
301
+ (`#82258 <https://github.com/llvm/llvm-project/issues/82258 >`_)
302
+ - Correctly immediate-escalate lambda conversion functions.
303
+ (`#82258 <https://github.com/llvm/llvm-project/issues/82258 >`_)
300
304
301
305
Bug Fixes to AST Handling
302
306
^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -1158,7 +1158,9 @@ class Sema final {
1158
1158
if (FD) {
1159
1159
FD->setWillHaveBody(true);
1160
1160
S.ExprEvalContexts.back().InImmediateFunctionContext =
1161
- FD->isImmediateFunction();
1161
+ FD->isImmediateFunction() ||
1162
+ S.ExprEvalContexts[S.ExprEvalContexts.size() - 2]
1163
+ .isConstantEvaluated();
1162
1164
S.ExprEvalContexts.back().InImmediateEscalatingFunctionContext =
1163
1165
S.getLangOpts().CPlusPlus20 && FD->isImmediateEscalating();
1164
1166
} else
Original file line number Diff line number Diff line change @@ -18311,7 +18311,6 @@ void Sema::CheckUnusedVolatileAssignment(Expr *E) {
18311
18311
}
18312
18312
18313
18313
void Sema::MarkExpressionAsImmediateEscalating(Expr *E) {
18314
- assert(!FunctionScopes.empty() && "Expected a function scope");
18315
18314
assert(getLangOpts().CPlusPlus20 &&
18316
18315
ExprEvalContexts.back().InImmediateEscalatingFunctionContext &&
18317
18316
"Cannot mark an immediate escalating expression outside of an "
@@ -18328,7 +18327,8 @@ void Sema::MarkExpressionAsImmediateEscalating(Expr *E) {
18328
18327
} else {
18329
18328
assert(false && "expected an immediately escalating expression");
18330
18329
}
18331
- getCurFunction()->FoundImmediateEscalatingExpression = true;
18330
+ if (FunctionScopeInfo *FI = getCurFunction())
18331
+ FI->FoundImmediateEscalatingExpression = true;
18332
18332
}
18333
18333
18334
18334
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