efriedma added inline comments.

================
Comment at: lib/CodeGen/CGExprConstant.cpp:1340
+          return C;
+        return getNullPtr(PT, DestType);
       }
----------------
Consider code like the following:

    int x = 0;
    auto y1 = (__specialaddrspace int*)0;
    auto y2 = (__specialaddrspace int*)((void)0, 0);
    auto y3 = (__specialaddrspace int*)x;

How do you expect these three cases to behave?  (The first case involves a C 
null pointer constant, the second and third cases are different ways of writing 
a general int->ptr conversion.)


https://reviews.llvm.org/D26196



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

Reply via email to