Bug 526975 - Deduce return type correctly in the presence of multiple return statements

The previous implementation deviated from the C++ standard by checking
that the types of the return expressions are the same, rather than the
return types after deduction against the placeholder type.

There was also a bug in the return type deduction code for lambdas,
where for a lambda without an explicit placeholder in the trailing-
return-type, the deduction process wouldn't be performed.

Change-Id: I2f0b9f1c7778aef60e4cd7ada9386b99be52669a
3 files changed