[Sema][ObjC] Invalidate BlockDecl with invalid return expr & its parent BlockExpr
authordingfei <fding@feysh.com>
Mon, 24 Jul 2023 10:21:14 +0000 (18:21 +0800)
committerdingfei <fding@feysh.com>
Mon, 24 Jul 2023 10:24:32 +0000 (18:24 +0800)
commit106bde9ab2bdffb2409311ef2d4f2c3c9ca77d3f
tree82828f16d4c80ae65d7d4d33802bced0ad85841e
parent2f1244cfdaa2e90cf45f00d5e9aa337335c31001
[Sema][ObjC] Invalidate BlockDecl with invalid return expr & its parent BlockExpr

Invalidate BlockDecl with implicit return type, in case any of the return value exprs is invalid.
Propagating the error info up by replacing BlockExpr with a RecoveryExpr.

The idea of this fix is given by @hokein(Haojian Wu)

Fix https://github.com/llvm/llvm-project/issues/63863.

Differential Revision: https://reviews.llvm.org/D155396
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaStmt.cpp
clang/test/AST/ast-dump-recovery.m