| Summary: | Parser misinterprets return statement in lambda | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nathan Ridge <zeratul976> |
| Component: | cdt-codan | Assignee: | Elena Laskavaia <elaskavaia.cdt> |
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, malaperle |
| Version: | 8.0 | ||
| Target Milestone: | 8.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
For this code: void f() { [](int r){return r;}(5); } The parser gives the error: Return has value, in function returning void It seems the parser is misinterpreting the return statement inside the lambda to be a return statement for the enclosing function, for if I change f to return int instead of void, the error goes away.