summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-12-27 15:26:27 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-12-27 15:26:27 +0000
commitd8f265a5b8f924dd824b559c1dae5f3291262708 (patch)
tree5a46b6ed53621a9d3f0688acd087e41f684d5e65
parent4a42cf69a607c2ea0886eeed6562ea7810a4c1cb (diff)
downloadbcm5719-llvm-d8f265a5b8f924dd824b559c1dae5f3291262708.tar.gz
bcm5719-llvm-d8f265a5b8f924dd824b559c1dae5f3291262708.zip
Simplify typeid 'potentially evaluated' check.
llvm-svn: 171162
-rw-r--r--clang/include/clang/AST/EvaluatedExprVisitor.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/include/clang/AST/EvaluatedExprVisitor.h b/clang/include/clang/AST/EvaluatedExprVisitor.h
index 03138a15bd2..62c35990b3d 100644
--- a/clang/include/clang/AST/EvaluatedExprVisitor.h
+++ b/clang/include/clang/AST/EvaluatedExprVisitor.h
@@ -60,13 +60,8 @@ public:
}
void VisitCXXTypeidExpr(CXXTypeidExpr *E) {
- // typeid(expression) is potentially evaluated when the argument is
- // a glvalue of polymorphic type. (C++ 5.2.8p2-3)
- if (!E->isTypeOperand() && E->Classify(Context).isGLValue())
- if (const RecordType *Record
- = E->getExprOperand()->getType()->template getAs<RecordType>())
- if (cast<CXXRecordDecl>(Record->getDecl())->isPolymorphic())
- return this->Visit(E->getExprOperand());
+ if (E->isPotentiallyEvaluated())
+ return this->Visit(E->getExprOperand());
}
/// \brief The basis case walks all of the children of the statement or
OpenPOWER on IntegriCloud