r251391 - Work around incomplete list initialization support in older MSVC.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 00:25:29 PDT 2015


Author: rsmith
Date: Tue Oct 27 02:25:29 2015
New Revision: 251391

URL: http://llvm.org/viewvc/llvm-project?rev=251391&view=rev
Log:
Work around incomplete list initialization support in older MSVC.

Modified:
    cfe/trunk/include/clang/AST/ExprCXX.h
    cfe/trunk/include/clang/AST/StmtCXX.h

Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=251391&r1=251390&r2=251391&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Tue Oct 27 02:25:29 2015
@@ -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 {

Modified: cfe/trunk/include/clang/AST/StmtCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtCXX.h?rev=251391&r1=251390&r2=251391&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtCXX.h (original)
+++ cfe/trunk/include/clang/AST/StmtCXX.h Tue Oct 27 02:25:29 2015
@@ -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.




More information about the cfe-commits mailing list