diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-23 23:12:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-23 23:12:31 +0000 |
commit | 0369c57ac6794c82ef3b35f2e6cae9e46debc4f7 (patch) | |
tree | 8045f39374ddfcbefd84641a38bbe9021cecaf51 /clang/lib/Sema/SemaStmt.cpp | |
parent | e6447ef98952cb38c8fcde42523406bb9dd7359a (diff) | |
download | bcm5719-llvm-0369c57ac6794c82ef3b35f2e6cae9e46debc4f7.tar.gz bcm5719-llvm-0369c57ac6794c82ef3b35f2e6cae9e46debc4f7.zip |
Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.
llvm-svn: 59920
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 204d161f563..8cd223fc39d 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -195,7 +195,7 @@ Sema::ActOnLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II, // multiply defined, reject it now. if (LabelDecl->getSubStmt()) { Diag(IdentLoc, diag::err_redefinition_of_label) << LabelDecl->getID(); - Diag(LabelDecl->getIdentLoc(), diag::err_previous_definition); + Diag(LabelDecl->getIdentLoc(), diag::note_previous_definition); return SubStmt; } @@ -390,7 +390,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch, if (DefaultStmt *DS = dyn_cast<DefaultStmt>(SC)) { if (TheDefaultStmt) { Diag(DS->getDefaultLoc(), diag::err_multiple_default_labels_defined); - Diag(TheDefaultStmt->getDefaultLoc(), diag::err_first_label); + Diag(TheDefaultStmt->getDefaultLoc(), diag::note_duplicate_case_prev); // FIXME: Remove the default statement from the switch block so that // we'll return a valid AST. This requires recursing down the @@ -436,7 +436,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch, Diag(CaseVals[i+1].second->getLHS()->getLocStart(), diag::err_duplicate_case) << CaseVals[i].first.toString(10); Diag(CaseVals[i].second->getLHS()->getLocStart(), - diag::err_duplicate_case_prev); + diag::note_duplicate_case_prev); // FIXME: We really want to remove the bogus case stmt from the substmt, // but we have no way to do this right now. CaseListIsErroneous = true; @@ -520,7 +520,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtTy *Switch, Diag(CR->getLHS()->getLocStart(), diag::err_duplicate_case) << OverlapVal.toString(10); Diag(OverlapStmt->getLHS()->getLocStart(), - diag::err_duplicate_case_prev); + diag::note_duplicate_case_prev); // FIXME: We really want to remove the bogus case stmt from the substmt, // but we have no way to do this right now. CaseListIsErroneous = true; |