[cfe-commits] r39283 - in /cfe/cfe/trunk: AST/SemaDecl.cpp Sema/SemaDecl.cpp

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:42:27 PDT 2007


Author: sabre
Date: Wed Jul 11 11:42:27 2007
New Revision: 39283

URL: http://llvm.org/viewvc/llvm-project?rev=39283&view=rev
Log:
fix some incorrect assertions

Modified:
    cfe/cfe/trunk/AST/SemaDecl.cpp
    cfe/cfe/trunk/Sema/SemaDecl.cpp

Modified: cfe/cfe/trunk/AST/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaDecl.cpp?rev=39283&r1=39282&r2=39283&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/SemaDecl.cpp (original)
+++ cfe/cfe/trunk/AST/SemaDecl.cpp Wed Jul 11 11:42:27 2007
@@ -141,10 +141,11 @@
   const DeclaratorChunk::ParamInfo &PI = FTI.Fun.ArgInfo[ArgNo];
 
   IdentifierInfo *II = PI.Ident;
+  // TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
+  // Can this happen for params?  We already checked that they don't conflict
+  // among each other.  Here they can only shadow globals, which is ok.
   if (Decl *PrevDecl = LookupScopedDecl(II, Decl::IDNS_Ordinary)) {
     
-    // TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
-    assert(PrevDecl == 0 && "FIXME: Unimp!");
   }
   
   VarDecl *New = new VarDecl(PI.IdentLoc, II, static_cast<Type*>(PI.TypeInfo));
@@ -271,7 +272,7 @@
                              SourceLocation KWLoc, IdentifierInfo *Name,
                              SourceLocation NameLoc) {
   // If this is a use of an existing tag, it must have a name.
-  assert((isUse || Name != 0) && "Nameless record must have a name!");
+  assert((!isUse || Name != 0) && "Nameless record must be a definition!");
   
   Decl::Kind Kind;
   switch (TagType) {

Modified: cfe/cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaDecl.cpp?rev=39283&r1=39282&r2=39283&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaDecl.cpp Wed Jul 11 11:42:27 2007
@@ -141,10 +141,11 @@
   const DeclaratorChunk::ParamInfo &PI = FTI.Fun.ArgInfo[ArgNo];
 
   IdentifierInfo *II = PI.Ident;
+  // TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
+  // Can this happen for params?  We already checked that they don't conflict
+  // among each other.  Here they can only shadow globals, which is ok.
   if (Decl *PrevDecl = LookupScopedDecl(II, Decl::IDNS_Ordinary)) {
     
-    // TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
-    assert(PrevDecl == 0 && "FIXME: Unimp!");
   }
   
   VarDecl *New = new VarDecl(PI.IdentLoc, II, static_cast<Type*>(PI.TypeInfo));
@@ -271,7 +272,7 @@
                              SourceLocation KWLoc, IdentifierInfo *Name,
                              SourceLocation NameLoc) {
   // If this is a use of an existing tag, it must have a name.
-  assert((isUse || Name != 0) && "Nameless record must have a name!");
+  assert((!isUse || Name != 0) && "Nameless record must be a definition!");
   
   Decl::Kind Kind;
   switch (TagType) {





More information about the cfe-commits mailing list