aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-29 05:12:23 +0000
committerChris Lattner <sabre@nondot.org>2009-04-29 05:12:23 +0000
commit65e6a093b1aeeab919025ff979a9f874cdffa628 (patch)
tree3db81759bc5e23740f068020d6d4026d9615062a /lib/Sema/SemaDecl.cpp
parent8711c03dda12863a7537f14025513f7717b14ce1 (diff)
Fix PR4092 by improving error recovery in two ways:
1. In a struct field redefinition, don't mark the struct erroneous. The field is erroneous, but the struct is otherwise well formed. 2. Don't emit diagnostics about functions that are known to be broken already. Either fix is sufficient to silence the second diagnostic in the example, but the combination is better :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 4427f0de1f..14136a30b6 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2895,6 +2895,7 @@ Sema::DeclPtrTy Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
// (C99 6.9.1p3, C++ [dcl.fct]p6).
QualType ResultType = FD->getResultType();
if (!ResultType->isDependentType() && !ResultType->isVoidType() &&
+ !FD->isInvalidDecl() &&
RequireCompleteType(FD->getLocation(), ResultType,
diag::err_func_def_incomplete_result))
FD->setInvalidDecl();
@@ -3713,7 +3714,6 @@ FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
Diag(Loc, diag::err_duplicate_member) << II;
Diag(PrevDecl->getLocation(), diag::note_previous_declaration);
NewFD->setInvalidDecl();
- Record->setInvalidDecl();
}
if (getLangOptions().CPlusPlus && !T->isPODType())