Remember whether an initlist had a designator in the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58218 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index fee9456..5304fd9 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -22,6 +22,7 @@
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/Parse/DeclSpec.h"
+#include "clang/Parse/Designator.h"
 #include "clang/Parse/Scope.h"
 using namespace clang;
 
@@ -1260,7 +1261,8 @@
   // Semantic analysis for initializers is done by ActOnDeclarator() and
   // CheckInitializer() - it requires knowledge of the object being intialized. 
   
-  InitListExpr *E = new InitListExpr(LBraceLoc, InitList, NumInit, RBraceLoc);
+  InitListExpr *E = new InitListExpr(LBraceLoc, InitList, NumInit, RBraceLoc,
+                                     Designators.hasAnyDesignators());
   E->setType(Context.VoidTy); // FIXME: just a place holder for now.
   return E;
 }
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 12ca382..0e627a1 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -87,7 +87,8 @@
   // Synthesize an "implicit" InitListExpr (marked by the invalid source locs).
   InitListExpr *ILE = new InitListExpr(SourceLocation(), 
                                        &InitExprs[0], InitExprs.size(), 
-                                       SourceLocation());
+                                       SourceLocation(),
+                                       ParentIList->hadDesignators());
   ILE->setType(T);
 
   // Modify the parent InitListExpr to point to the implicit InitListExpr.