Fix a crash when there is a typo in the return statement.
authorManman Ren <manman.ren@gmail.com>
Thu, 4 Feb 2016 20:05:40 +0000 (20:05 +0000)
committerManman Ren <manman.ren@gmail.com>
Thu, 4 Feb 2016 20:05:40 +0000 (20:05 +0000)
commitb4e8a1b3087347b78d57e467186f5113454a2816
tree763285c712fa5f8aedc0ae51f60748ef4966bf91
parent5527a9dd42f0a9e09353699252f0d4fcd001923b
Fix a crash when there is a typo in the return statement.

If the typo happens after a successful deduction for an earlier
return statement, we should check if the deduced type is null
before using it.

The typo correction happens after we try to deduce the return
type and we ignore the deduction from the typo and continue
to typo correction.

rdar://24342247

llvm-svn: 259820
clang/lib/Sema/SemaStmt.cpp
clang/test/SemaCXX/typo-correction-crash.cpp [new file with mode: 0644]