Ensure we peer through () when handling typeid(*p).

llvm-svn: 89015
This commit is contained in:
Mike Stump
2009-11-17 00:45:21 +00:00
parent 7c57c41d5f
commit c2c03349f3
2 changed files with 2 additions and 2 deletions

View File

@@ -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<NonNullAttr>()
bool CanBeZero = false;
if (UnaryOperator *UO = dyn_cast<UnaryOperator>(subE))
if (UnaryOperator *UO = dyn_cast<UnaryOperator>(subE->IgnoreParens()))
if (UO->getOpcode() == UnaryOperator::Deref)
CanBeZero = true;
if (CanBeZero) {

View File

@@ -102,7 +102,7 @@ void test2_2(test1_D *dp) {
test2_1();
if (typeid(NP) == typeid(test1_D))
test2_1();
if (typeid(*dp) == typeid(test1_D))
if (typeid(((*(dp)))) == typeid(test1_D))
test2_1();
}