mirror of
https://github.com/intel/llvm.git
synced 2026-02-02 01:30:24 +08:00
Ensure we peer through () when handling typeid(*p).
llvm-svn: 89015
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user