Address Richard's comments.

llvm-svn: 213402
This commit is contained in:
David Majnemer 2014-07-18 19:53:21 +00:00
parent 4fbb1b9f98
commit 18a9ac9129
2 changed files with 13 additions and 0 deletions

View File

@ -1618,6 +1618,9 @@ void CodeGenFunction::EmitCXXDeleteExpr(const CXXDeleteExpr *E) {
static bool isGLValueFromPointerDeref(const Expr *E) {
E = E->IgnoreParenCasts();
if (isa<ArraySubscriptExpr>(E))
return true;
if (const auto *UO = dyn_cast<UnaryOperator>(E))
if (UO->getOpcode() == UO_Deref)
return true;

View File

@ -42,3 +42,13 @@ void f7(A *x) { typeid((*x)); }
// CHECK-LABEL: define void @_Z2f7P1A
// CHECK: icmp eq {{.*}}, null
// CHECK-NEXT: br i1
void f8(A *x) { typeid(x[0]); }
// CHECK-LABEL: define void @_Z2f8P1A
// CHECK: icmp eq {{.*}}, null
// CHECK-NEXT: br i1
void f9(A *x) { typeid(0[x]); }
// CHECK-LABEL: define void @_Z2f9P1A
// CHECK: icmp eq {{.*}}, null
// CHECK-NEXT: br i1