[cfe-commits] r72478 - /cfe/trunk/lib/Sema/SemaInit.cpp
Anders Carlsson
andersca at mac.com
Wed May 27 09:39:15 PDT 2009
Author: andersca
Date: Wed May 27 11:38:58 2009
New Revision: 72478
URL: http://llvm.org/viewvc/llvm-project?rev=72478&view=rev
Log:
Fix another test case.
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=72478&r1=72477&r2=72478&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Wed May 27 11:38:58 2009
@@ -156,6 +156,14 @@
// class of the destination, constructors are considered.
if ((DeclTypeC.getUnqualifiedType() == InitTypeC.getUnqualifiedType()) ||
IsDerivedFrom(InitTypeC, DeclTypeC)) {
+ const CXXRecordDecl *RD =
+ cast<CXXRecordDecl>(DeclType->getAsRecordType()->getDecl());
+
+ // No need to make a CXXConstructExpr if both the ctor and dtor are
+ // trivial.
+ if (RD->hasTrivialConstructor() && RD->hasTrivialDestructor())
+ return false;
+
CXXConstructorDecl *Constructor
= PerformInitializationByConstructor(DeclType, &Init, 1,
InitLoc, Init->getSourceRange(),
More information about the cfe-commits
mailing list