Page MenuHomePhabricator

Fix Bug 23189 in C++14 type inference for lambdas with undeclared identifiers
Needs RevisionPublic

Authored by tdudziak on May 20 2015, 7:04 AM.

Details

Reviewers
dim
rsmith
Summary

Fixes Bug 23189 by adding additional checks in DeduceFunctionTypeFromReturnExpr.

Without these checks, the code attempts to dereference a null pointer when trying to infer the return type of a lambda if there are multiple return statements and one of them contains an expression with an undeclared identifier.

Diff Detail

Event Timeline

tdudziak updated this revision to Diff 26150.May 20 2015, 7:04 AM
tdudziak retitled this revision from to Fix Bug 23189 in C++14 type inference for lambdas with undeclared identifiers.
tdudziak updated this object.
tdudziak edited the test plan for this revision. (Show Details)
tdudziak added reviewers: dim, yaron.keren, rsmith.
tdudziak added a subscriber: Unknown Object (MLST).
dim accepted this revision.Jun 1 2015, 11:41 AM
dim edited edge metadata.

It looks good to me, and it fixes both the original test case in bug 23189, and the reduced test case I added there.

This revision is now accepted and ready to land.Jun 1 2015, 11:41 AM
rsmith edited edge metadata.Jun 1 2015, 12:33 PM

Kaelyn, should we do typo correction sooner here?

rsmith added inline comments.Jun 1 2015, 8:48 PM
lib/Sema/SemaStmt.cpp
2983–2989

Dependent types are supposed to be eliminated by this check. I think the right thing to do is to correct typos in the expression before we get to this point.

rsmith requested changes to this revision.Jun 1 2015, 8:48 PM
rsmith edited edge metadata.
This revision now requires changes to proceed.Jun 1 2015, 8:48 PM
yaron.keren resigned from this revision.Mar 30 2017, 12:08 PM