Skip to content

Commit 0675ca4

Browse files
author
git apple-llvm automerger
committed
Merge commit '7d6969bc6f86' from llvm.org/release/21.x into stable/21.x
2 parents 231ae01 + 7d6969b commit 0675ca4

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

clang/lib/Parse/ParseExpr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3380,7 +3380,8 @@ ExprResult Parser::ParseBlockLiteralExpression() {
33803380
Actions.ActOnBlockError(CaretLoc, getCurScope());
33813381
return ExprError();
33823382
}
3383-
3383+
EnterExpressionEvaluationContextForFunction PotentiallyEvaluated(
3384+
Actions, Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
33843385
StmtResult Stmt(ParseCompoundStatementBody());
33853386
BlockScope.Exit();
33863387
if (!Stmt.isInvalid())
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -fobjc-arc -fblocks %s
2+
3+
void block_receiver(int (^)() );
4+
5+
int f1() {
6+
if constexpr (0)
7+
(block_receiver)(^{ return 2; });
8+
return 1;
9+
}
10+
11+
int f2() {
12+
if constexpr (0)
13+
return (^{ return 2; })();
14+
return 1;
15+
}

0 commit comments

Comments
 (0)