[cfe-commits] r100175 - in /cfe/trunk/lib/Sema: Sema.h SemaDeclCXX.cpp

Anders Carlsson andersca at mac.com
Thu Apr 1 20:43:34 PDT 2010


Author: andersca
Date: Thu Apr  1 22:43:34 2010
New Revision: 100175

URL: http://llvm.org/viewvc/llvm-project?rev=100175&view=rev
Log:
More cleanup.

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

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=100175&r1=100174&r2=100175&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Thu Apr  1 22:43:34 2010
@@ -2478,9 +2478,7 @@
 
   bool SetBaseOrMemberInitializers(CXXConstructorDecl *Constructor,
                                    CXXBaseOrMemberInitializer **Initializers,
-                                   unsigned NumInitializers,
-                                   bool IsImplicitConstructor,
-                                   bool AnyErrors);
+                                   unsigned NumInitializers, bool AnyErrors);
 
   /// MarkBaseAndMemberDestructorsReferenced - Given a record decl,
   /// mark all the non-trivial destructors of its members and bases as

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=100175&r1=100174&r2=100175&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Apr  1 22:43:34 2010
@@ -1429,9 +1429,8 @@
 Sema::SetBaseOrMemberInitializers(CXXConstructorDecl *Constructor,
                                   CXXBaseOrMemberInitializer **Initializers,
                                   unsigned NumInitializers,
-                                  bool IsImplicitConstructor,
                                   bool AnyErrors) {
-  assert((Constructor->isImplicit() == IsImplicitConstructor));
+//  assert((Constructor->isImplicit() == IsImplicitConstructor));
 
   // We need to build the initializer AST according to order of construction
   // and not what user specified in the Initializers list.
@@ -1630,14 +1629,14 @@
     }
     else if (FT->isReferenceType()) {
       Diag(Constructor->getLocation(), diag::err_uninitialized_member_in_ctor)
-        << (int)IsImplicitConstructor << Context.getTagDeclType(ClassDecl)
+        << (int)Constructor->isImplicit() << Context.getTagDeclType(ClassDecl)
         << 0 << (*Field)->getDeclName();
       Diag((*Field)->getLocation(), diag::note_declared_at);
       HadError = true;
     }
     else if (FT.isConstQualified()) {
       Diag(Constructor->getLocation(), diag::err_uninitialized_member_in_ctor)
-        << (int)IsImplicitConstructor << Context.getTagDeclType(ClassDecl)
+        << (int)Constructor->isImplicit() << Context.getTagDeclType(ClassDecl)
         << 1 << (*Field)->getDeclName();
       Diag((*Field)->getLocation(), diag::note_declared_at);
       HadError = true;
@@ -1842,10 +1841,9 @@
       return;
   }
 
-  SetBaseOrMemberInitializers(Constructor, MemInits, NumMemInits, 
-                              /*IsImplicitConstructor=*/false, AnyErrors);
-
   DiagnoseBaseOrMemInitializerOrder(*this, Constructor, MemInits, NumMemInits);
+
+  SetBaseOrMemberInitializers(Constructor, MemInits, NumMemInits, AnyErrors);
 }
 
 void
@@ -1943,9 +1941,7 @@
 
   if (CXXConstructorDecl *Constructor
       = dyn_cast<CXXConstructorDecl>(CDtorDecl.getAs<Decl>()))
-    SetBaseOrMemberInitializers(Constructor, 0, 0, 
-                                /*IsImplicitConstructor=*/false,
-                                /*AnyErrors=*/false);
+    SetBaseOrMemberInitializers(Constructor, 0, 0, /*AnyErrors=*/false);
 }
 
 bool Sema::RequireNonAbstractType(SourceLocation Loc, QualType T,
@@ -3798,9 +3794,7 @@
 
   DeclContext *PreviousContext = CurContext;
   CurContext = Constructor;
-  if (SetBaseOrMemberInitializers(Constructor, 0, 0, 
-                                  /*IsImplicitConstructor=*/true, 
-                                  /*AnyErrors=*/false)) {
+  if (SetBaseOrMemberInitializers(Constructor, 0, 0, /*AnyErrors=*/false)) {
     Diag(CurrentLocation, diag::note_member_synthesized_at) 
       << CXXDefaultConstructor << Context.getTagDeclType(ClassDecl);
     Constructor->setInvalidDecl();





More information about the cfe-commits mailing list