[cfe-commits] r69292 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Anders Carlsson andersca at mac.com
Thu Apr 16 08:50:17 PDT 2009


Author: andersca
Date: Thu Apr 16 10:50:16 2009
New Revision: 69292

URL: http://llvm.org/viewvc/llvm-project?rev=69292&view=rev
Log:
When we create an implicit CXXTemporaryObjectExpr we don't need to check that it's a valid init. Instead, just set it as the VarDecl's initializer.

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

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Apr 16 10:50:16 2009
@@ -1827,10 +1827,6 @@
     if (!Constructor)
       RealDecl->setInvalidDecl();
     else {
-#if 0
-      // FIXME: Adding the initializer causes an error in 
-      // test/SemaCXX/default2.cpp so it's disabled for now.
-      
       // Let clients know that initialization was done with a direct
       // initializer.
       VDecl->setCXXDirectInitializer(true);
@@ -1841,8 +1837,7 @@
                                              (Expr**)Exprs.release(), 
                                              NumExprs,
                                              SourceLocation());
-      AddInitializerToDecl(Dcl, ExprArg(*this, Temp), /*DirectInit=*/true);
-#endif
+      VDecl->setInit(Temp);
     }
     return;
   }





More information about the cfe-commits mailing list