================
Comment at: lib/CodeGen/CGExprCXX.cpp:1618
@@ -1617,1 +1617,3 @@
 
+static bool isGLValueFromPointerDeref(const Expr *E) {
+  E = E->IgnoreParenCasts();
----------------
Richard Smith wrote:
> This doesn't handle
> 
>   ((T*)nullptr)[0]
> 
> Its semantics are defined in terms of a desugaring to
> 
>   *((T*)nullptr + 0)
> 
> ... so I suppose we should probably handle it here, but it's not entirely 
> clear.
I've updated `isGLValueFromPointerDeref` to handle this.

================
Comment at: lib/CodeGen/CGExprCXX.cpp:1619
@@ +1618,3 @@
+static bool isGLValueFromPointerDeref(const Expr *E) {
+  E = E->IgnoreParenCasts();
+
----------------
Richard Smith wrote:
> I think this will insert a null check for
> 
>   T *p;
>   typeid( (const T&)(T)*p )
> 
> ... which doesn't seem strictly necessary (though superfluous null checks 
> here seem pretty harmless).
I can live with inserting an extra null check here.

http://reviews.llvm.org/D4416



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to