diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-02 01:05:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-02 01:05:10 +0000 |
commit | fd89bc825026e44c68a68db72d4012fd6752e70f (patch) | |
tree | 1a44d1628d544d8da60ac6b3cb9dcc1cc9568765 /lib/Sema/SemaDecl.cpp | |
parent | c822ff47d29eb3888796145dbc58d17f747a1e61 (diff) |
Fix PR2017 and silence some bogus errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index c958dd1027..2d0251cc14 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -951,7 +951,7 @@ Sema::DeclTy *Sema::FinalizeDeclaratorGroup(Scope *S, DeclTy *group) { // Block scope. C99 6.7p7: If an identifier for an object is declared with // no linkage (C99 6.2.2p6), the type for the object shall be complete... if (BVD && IDecl->getStorageClass() != VarDecl::Extern) { - if (T->isIncompleteType()) { + if (T->isIncompleteType() && !IDecl->isInvalidDecl()) { Diag(IDecl->getLocation(), diag::err_typecheck_decl_incomplete_type, T.getAsString()); IDecl->setInvalidDecl(); @@ -967,7 +967,7 @@ Sema::DeclTy *Sema::FinalizeDeclaratorGroup(Scope *S, DeclTy *group) { if (T->isIncompleteArrayType()) { // C99 6.9.2 (p2, p5): Implicit initialization causes an incomplete // array to be completed. Don't issue a diagnostic. - } else if (T->isIncompleteType()) { + } else if (T->isIncompleteType() && !IDecl->isInvalidDecl()) { // C99 6.9.2p3: If the declaration of an identifier for an object is // a tentative definition and has internal linkage (C99 6.2.2p3), the // declared type shall not be an incomplete type. @@ -1100,7 +1100,8 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) { // C99 6.7.5.3p4: the parameters in a parameter type list in a function // declarator that is part of a function definition of that function // shall not have incomplete type. - if (parmDecl->getType()->isIncompleteType()) { + if (parmDecl->getType()->isIncompleteType() && + !parmDecl->isInvalidDecl()) { Diag(parmDecl->getLocation(), diag::err_typecheck_decl_incomplete_type, parmDecl->getType().getAsString()); parmDecl->setInvalidDecl(); |