From f42755ea9f0d8792e55dba28f1e013bc8223a676 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 27 Dec 2012 15:26:27 +0000 Subject: [PATCH] Simplify typeid 'potentially evaluated' check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171162 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/EvaluatedExprVisitor.h | 9 ++------- 1 file 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()) - if (cast(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 -- 2.50.1