[cfe-commits] r94793 - /cfe/trunk/lib/Sema/SemaInit.cpp

Anders Carlsson andersca at mac.com
Thu Jan 28 18:47:33 PST 2010


Author: andersca
Date: Thu Jan 28 20:47:33 2010
New Revision: 94793

URL: http://llvm.org/viewvc/llvm-project?rev=94793&view=rev
Log:
Simplify InitListChecker::CheckReferenceType

Modified:
    cfe/trunk/lib/Sema/SemaInit.cpp

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=94793&r1=94792&r2=94793&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Thu Jan 28 20:47:33 2010
@@ -785,17 +785,16 @@
       return;
     }
 
-    Expr *savExpr = expr; // Might be promoted by CheckSingleInitializer.
-    if (SemaRef.CheckReferenceInit(expr, DeclType,
-                                   /*FIXME:*/expr->getLocStart(),
-                                   /*SuppressUserConversions=*/false,
-                                   /*AllowExplicit=*/false,
-                                   /*ForceRValue=*/false))
+    Sema::OwningExprResult Result =
+      SemaRef.PerformCopyInitialization(Entity, expr->getLocStart(),
+                                        SemaRef.Owned(expr));
+
+    if (Result.isInvalid())
       hadError = true;
-    else if (savExpr != expr) {
-      // The type was promoted, update initializer list.
-      IList->setInit(Index, expr);
-    }
+
+    expr = Result.takeAs<Expr>();
+    IList->setInit(Index, expr);
+
     if (hadError)
       ++StructuredIndex;
     else
@@ -3270,7 +3269,7 @@
         S.Diag(BitField->getLocation(), diag::note_bitfield_decl);
         return S.ExprError();
       }
-        
+
       // Reference binding does not have any corresponding ASTs.
 
       // Check exception specifications





More information about the cfe-commits mailing list