Patch to fix an invalid AST of a locally redeclared built-in which causes an IRGen crash

jahanian fjahanian at apple.com
Thu May 22 13:48:15 PDT 2014


On May 22, 2014, at 11:40 AM, Richard Smith <richard at metafoo.co.uk> wrote:

> 
> Another problem with our current model is that we build a broken redeclaration chain (the local declaration is marked as being a redeclaration of the implicitly-declared builtin, which it isn't). This leads to other bugs; for instance:
> 
> void f() { int memcpy(void); } void g() { memcpy(0,0,0); }
> 
> ... misses the "implicitly declaring library function" warning.

Interesting point. Currently, we create a built-in declaration of “memcpy” and make local declaration as its redeclaration.
Should we just not create the implicit built-in declaration when user declaration is local? If we do this,
then the missing  warning you mentioned will come out (and my bug gets fixed). But, we will miss the warning 
about "incompatible redeclaration of library function ‘memcpy’” on local “redeclaration”.
Which, I think, is ok as it is no longer a redeclaration.
Am I reading you correctly?

- Fariborz

> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140522/55be3634/attachment.html>


More information about the cfe-commits mailing list