aboutsummaryrefslogtreecommitdiff
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
commitf42755ea9f0d8792e55dba28f1e013bc8223a676 (patch)
tree8acd500a957cc0b3d2e983ac25713b74f93228e9
parente57e3d3783586934e26191cfc06ed5f3d966ea9c (diff)
Simplify typeid 'potentially evaluated' check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171162 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/EvaluatedExprVisitor.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/include/clang/AST/EvaluatedExprVisitor.h b/include/clang/AST/EvaluatedExprVisitor.h
index 03138a15bd..62c35990b3 100644
--- a/include/clang/AST/EvaluatedExprVisitor.h
+++ b/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