Commit ec4e6aa
authored
[clang][ObjC] Fix incorrect return type inference for discarded blocks (llvm#154109)
When parsing a block expression we were not entering a new eval context
and as a result when parsing the block body we continue to treat any
return statements as discarded so infer a `void` result.
This fixes the problem by introducing an evaluation context around the
parsing of the body.1 parent 5612dc5 commit ec4e6aa
File tree
2 files changed
+17
-1
lines changed- clang
- lib/Parse
- test/SemaObjCXX
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3342 | 3342 | | |
3343 | 3343 | | |
3344 | 3344 | | |
3345 | | - | |
| 3345 | + | |
| 3346 | + | |
3346 | 3347 | | |
3347 | 3348 | | |
3348 | 3349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments