<div dir="ltr">Another approach is to inform Sema about context where the unknown name occurs. That would allow typo correction code to be gathered in one place in Sema. Such kind of typos could be processed by the same machinery in ActOnIdExpression, which now tries to make correction of misspelled names.<div>
<br><div>There are other typos that are nice to handle ("." vs ".*", dot instead of comma etc). Handling them in Parser could make the latter bulky.</div><div><br></div><div>Thanks,</div><div>--Serge</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/1 Kaelyn Uhrain <span dir="ltr"><<a href="mailto:rikka@google.com" target="_blank">rikka@google.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Attached is an initial patch for trying to correct a missing "-" or ">" to "->" when accessing a member through an object pointer. This patch also doesn't work for C code as C seems to hit a different code path. I'm sending the patch out for pre-commit review even though it is a small and fairly unobtrusive (code-wise) patch because I'm a bit iffy on whether it's a good way to perform the diagnostic.<div>

<br></div><div>For a bit of context, what makes this diagnostic tricky is that the original error about the unknown identifier after the "-" or ">" occurs well within Sema as the parser is handling the RHS of a binary operator, but the recovery would require following a code path in the parser that was part of the construction of the LHS. And since Sema cannot tell the parser to back up a few steps....</div>

<div><br></div><div>Cheers,</div><div>Kaelyn</div></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks,<br>--Serge<br>
</div>