arphaman added a comment.

In https://reviews.llvm.org/D34185#780494, @ahatanak wrote:

> This patch fixes the crash and that is fine, but the users might find the 
> last error ("expected '}'" at the end of the file) confusing. This seems to 
> happen because Parser::ParseLexedObjCMethodDefs consumes all tokens in the 
> file until it sees the EOF after consuming all the cached tokens of 
> LexedMethod.
>
> I wonder whether we can insert a fake EOF token to prevent 
> ParseLexedObjCMethodDefs from going all the way to the end, just like 
> ParseCXXNonStaticMemberInitialize does. Do you think that would work or would 
> it be too hackish?


I think that it would probably work quite well. I've thought about fixing it 
while working on a patch as well, but didn't realize that we could just inject 
EOF into the token stream. I will update this patch with this kind of handling 
then.


Repository:
  rL LLVM

https://reviews.llvm.org/D34185



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to