fix some incorrect assertions

llvm-svn: 39283
This commit is contained in:
Chris Lattner 2007-01-23 05:14:32 +00:00
parent b9d572a0a8
commit c284e9b905
2 changed files with 8 additions and 6 deletions

View File

@ -141,10 +141,11 @@ Sema::ParseParamDeclarator(DeclaratorChunk &FTI, unsigned ArgNo,
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 @@ Sema::DeclTy *Sema::ParseTag(Scope *S, unsigned TagType, bool isUse,
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) {

View File

@ -141,10 +141,11 @@ Sema::ParseParamDeclarator(DeclaratorChunk &FTI, unsigned ArgNo,
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 @@ Sema::DeclTy *Sema::ParseTag(Scope *S, unsigned TagType, bool isUse,
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) {