]> granicus.if.org Git - clang/commitdiff
Work around incomplete list initialization support in older MSVC.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 27 Oct 2015 07:25:29 +0000 (07:25 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 27 Oct 2015 07:25:29 +0000 (07:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251391 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ExprCXX.h
include/clang/AST/StmtCXX.h

index 055542650f48d885a322cc1bc243306b37b3b6d0..cd14afaf40015640576b6349154ec11b09aeb25d 100644 (file)
@@ -4040,16 +4040,29 @@ public:
              Resume->isValueDependent(),
              Operand->isInstantiationDependent(),
              Operand->containsUnexpandedParameterPack()),
-      CoawaitLoc(CoawaitLoc),
-      SubExprs{Operand, Ready, Suspend, Resume} {}
+      CoawaitLoc(CoawaitLoc) {
+    SubExprs[CoawaitExpr::Operand] = Operand;
+    SubExprs[CoawaitExpr::Ready] = Ready;
+    SubExprs[CoawaitExpr::Suspend] = Suspend;
+    SubExprs[CoawaitExpr::Resume] = Resume;
+  }
   CoawaitExpr(SourceLocation CoawaitLoc, QualType Ty, Expr *Operand)
       : Expr(CoawaitExprClass, Ty, VK_RValue, OK_Ordinary,
              true, true, true, Operand->containsUnexpandedParameterPack()),
-        CoawaitLoc(CoawaitLoc), SubExprs{Operand} {
+        CoawaitLoc(CoawaitLoc) {
     assert(Operand->isTypeDependent() && Ty->isDependentType() &&
            "wrong constructor for non-dependent co_await expression");
+    SubExprs[CoawaitExpr::Operand] = Operand;
+    SubExprs[CoawaitExpr::Ready] = nullptr;
+    SubExprs[CoawaitExpr::Suspend] = nullptr;
+    SubExprs[CoawaitExpr::Resume] = nullptr;
+  }
+  CoawaitExpr(EmptyShell Empty) : Expr(CoawaitExprClass, Empty) {
+    SubExprs[CoawaitExpr::Operand] = nullptr;
+    SubExprs[CoawaitExpr::Ready] = nullptr;
+    SubExprs[CoawaitExpr::Suspend] = nullptr;
+    SubExprs[CoawaitExpr::Resume] = nullptr;
   }
-  CoawaitExpr(EmptyShell Empty) : Expr(CoawaitExprClass, Empty) {}
 
   SourceLocation getKeywordLoc() const { return CoawaitLoc; }
   Expr *getOperand() const {
index 1dfc74425ee3c002fd87c32ac9709bfae1e84678..982181e37177a6f244f90acae00dfc6331abc32f 100644 (file)
@@ -298,7 +298,9 @@ class CoroutineBodyStmt : public Stmt {
   friend class ASTStmtReader;
 public:
   CoroutineBodyStmt(Stmt *Body)
-      : Stmt(CoroutineBodyStmtClass), SubStmts{Body} {}
+      : Stmt(CoroutineBodyStmtClass) {
+    SubStmts[CoroutineBodyStmt::Body] = Body;
+  }
 
   /// \brief Retrieve the body of the coroutine as written. This will be either
   /// a CompoundStmt or a TryStmt.