[cfe-commits] r171162 - /cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h
Richard Smith
richard-llvm at metafoo.co.uk
Thu Dec 27 07:26:27 PST 2012
Author: rsmith
Date: Thu Dec 27 09:26:27 2012
New Revision: 171162
URL: http://llvm.org/viewvc/llvm-project?rev=171162&view=rev
Log:
Simplify typeid 'potentially evaluated' check.
Modified:
cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h
Modified: cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h?rev=171162&r1=171161&r2=171162&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h (original)
+++ cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h Thu Dec 27 09:26:27 2012
@@ -60,13 +60,8 @@
}
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
More information about the cfe-commits
mailing list