From c2c03349f35662eeba595af9ca9eca20ae1dc900 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Tue, 17 Nov 2009 00:45:21 +0000 Subject: Ensure we peer through () when handling typeid(*p). llvm-svn: 89015 --- clang/lib/CodeGen/CGCXXExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib') diff --git a/clang/lib/CodeGen/CGCXXExpr.cpp b/clang/lib/CodeGen/CGCXXExpr.cpp index eff432a05c0..75740af0744 100644 --- a/clang/lib/CodeGen/CGCXXExpr.cpp +++ b/clang/lib/CodeGen/CGCXXExpr.cpp @@ -372,7 +372,7 @@ llvm::Value * CodeGenFunction::EmitCXXTypeidExpr(const CXXTypeidExpr *E) { // We need to do a zero check for *p, unless it has NonNullAttr. // FIXME: PointerType->hasAttr() bool CanBeZero = false; - if (UnaryOperator *UO = dyn_cast(subE)) + if (UnaryOperator *UO = dyn_cast(subE->IgnoreParens())) if (UO->getOpcode() == UnaryOperator::Deref) CanBeZero = true; if (CanBeZero) { -- cgit v1.2.3