Patch for implementation of C++'s object model. This is
work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73782 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 9e31bae..c4d1fe9 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2732,8 +2732,12 @@
                                                  IK_Default);
         if (!Constructor)
           Var->setInvalidDecl();
-        else if (!RD->hasTrivialConstructor()) 
-          InitializeVarWithConstructor(Var, Constructor, InitType, 0, 0);
+        else  { 
+          if (!RD->hasTrivialConstructor())
+            InitializeVarWithConstructor(Var, Constructor, InitType, 0, 0);
+            // Check for valid construction.
+            DefineImplicitDefaultConstructor(Var->getLocation(), Constructor);
+        }
       }
     }