This is an archive of the discontinued LLVM Phabricator instance.

Avoid crash if default argument parsed with errors.
ClosedPublic

Authored by sepavloff on Jul 3 2014, 11:43 AM.

Details

Summary

If function parameters have default values, and that of the second
parameter is parsed with errors, function declaration would have
a parameter without default value that follows a parameter with
that. Such declaration breaks logic of selecting overloaded
function.

As a solution, erase default value of all parameters that precedes
the erroneous parameter.

This patch fixes PR20055.

Diff Detail

Repository
rL LLVM

Event Timeline

sepavloff updated this revision to Diff 11064.Jul 3 2014, 11:43 AM
sepavloff retitled this revision from to Avoid crash if default argument parsed with errors..
sepavloff updated this object.
sepavloff edited the test plan for this revision. (Show Details)
sepavloff added a subscriber: Unknown Object (MLST).
sepavloff updated this revision to Diff 11714.Jul 21 2014, 11:28 AM

Changed treatment of erroneous default value.

Indeed, using OpaqueValueExpr make code more readable. Thank you!

Thank you!

--Serge

2014-07-22 3:13 GMT+07:00 Richard Smith <richard@metafoo.co.uk>:

LGTM

http://reviews.llvm.org/D4378

sepavloff closed this revision.Jul 21 2014, 7:03 PM
sepavloff updated this revision to Diff 11734.

Closed by commit rL213594 (authored by @sepavloff).