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


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to