Commit b5b6ddc
committed
[clang][ObjC] Fix incorrect return type inference for discarded blocks
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 8f671a6 commit b5b6ddc
File tree
2 files changed
+12
-1
lines changed- clang
- lib/Parse
- test/CXX/stmt.stmt/stmt.select/stmt.if
2 files changed
+12
-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 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
257 | 267 | | |
258 | 268 | | |
259 | 269 | | |
0 commit comments