]> granicus.if.org Git - clang/commitdiff
One more case for Expr::isConstantInitializer; I think this covers
authorEli Friedman <eli.friedman@gmail.com>
Sun, 25 Jan 2009 03:27:40 +0000 (03:27 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sun, 25 Jan 2009 03:27:40 +0000 (03:27 +0000)
everything that we aren't intending to implement in Expr::Evaluate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62953 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp

index 1bb404ffeac02dd1ff1cb085708a178111a332df..defb0c3e91c3072ed48ba48842a067f69216a0ad 100644 (file)
@@ -732,6 +732,8 @@ bool Expr::isConstantInitializer(ASTContext &Ctx) const {
     if (getType()->isRecordType())
       return cast<CastExpr>(this)->getSubExpr()->isConstantInitializer(Ctx);
     break;
+  case DesignatedInitExprClass:
+    return cast<DesignatedInitExpr>(Init)->getInit()->isConstantInitializer(Ctx);
   }
 
   return isEvaluatable(Ctx);