Factor out computation of whether a typeid's expression is potentially
evaluated into a CXXTypeid member function. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161779 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 567002c..06c41a2 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -2881,6 +2881,9 @@
if (E->isTypeOperand())
return Success(E);
CXXRecordDecl *RD = E->getExprOperand()->getType()->getAsCXXRecordDecl();
+ // FIXME: The standard says "a typeid expression whose operand is of a
+ // polymorphic class type" is not a constant expression, but it probably
+ // means "a typeid expression whose operand is potentially evaluated".
if (RD && RD->isPolymorphic()) {
Info.Diag(E, diag::note_constexpr_typeid_polymorphic)
<< E->getExprOperand()->getType()