This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Handle TypoExpr for function calls correctly
AbandonedPublic

Authored by davide on Jun 23 2015, 3:05 PM.

Details

Reviewers
None
Summary

Discussed yesterday with rikka on IRC.
In the example of the test we call CheckFunctionCall with 'a' being a dependent type, C is not able to handle that correctly and we hit an assertion later on in the code.

(gdb) p TheCall->dump()
CallExpr 0x807dc07e0 'double'

-ImplicitCastExpr 0x807dc07c8 'double (*)(double)' <FunctionToPointerDecay>
`-DeclRefExpr 0x807dc0750 'double (double)' Function 0x807d6b8c0 'fabs' 'double (double)'

`-TypoExpr 0x807dc0790 '<dependent type>' lvalue

Force a call to CorrectDelayedTypoExpr() before we go through checkFunctionCall() to avoid the issue.
Do this only in !C++ because C++ is able ho handle dependent types properly.

Diff Detail

Event Timeline

davide updated this revision to Diff 28293.Jun 23 2015, 3:05 PM
davide retitled this revision from to [Sema] Handle TypoExpr for function calls correctly.
davide updated this object.
davide edited the test plan for this revision. (Show Details)
davide added a subscriber: Unknown Object (MLST).

Maybe I am missing something, but I don't see Clang crash with the given test case (using HEAD). In fact, the test case fails with and without the patch applied.

davide abandoned this revision.Jun 23 2015, 8:01 PM