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 | 5f4a6829dc58cab2f76e2b98492859aa3b91e3f2 (patch) | |
tree | c2c13ad4ad80fdb53222315c85fa883abf36becc /lib/Sema/SemaDeclCXX.cpp | |
parent | b8b96aff63e24ff1509f112de871f697aaea55f9 (diff) |
Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index a92ad9582e..d9f3bc652e 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -197,7 +197,7 @@ Sema::MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old) { Diag(NewParam->getLocation(), diag::err_param_default_argument_redefinition) << NewParam->getDefaultArg()->getSourceRange(); - Diag(OldParam->getLocation(), diag::err_previous_definition); + Diag(OldParam->getLocation(), diag::note_previous_definition); } else if (OldParam->getDefaultArg()) { // Merge the old default argument into the new parameter NewParam->setDefaultArg(OldParam->getDefaultArg()); @@ -1112,7 +1112,7 @@ Sema::DeclTy *Sema::ActOnConstructorDeclarator(CXXConstructorDecl *ConDecl) { if (!IsOverload(ConDecl, ClassDecl->getConstructors(), MatchedDecl)) { Diag(ConDecl->getLocation(), diag::err_constructor_redeclared) << SourceRange(ConDecl->getLocation()); - Diag((*MatchedDecl)->getLocation(), diag::err_previous_declaration) + Diag((*MatchedDecl)->getLocation(), diag::note_previous_declaration) << SourceRange((*MatchedDecl)->getLocation()); ConDecl->setInvalidDecl(); return ConDecl; @@ -1157,9 +1157,9 @@ Sema::DeclTy *Sema::ActOnDestructorDeclarator(CXXDestructorDecl *Destructor) { if (CXXDestructorDecl *PrevDestructor = ClassDecl->getDestructor()) { Diag(Destructor->getLocation(), diag::err_destructor_redeclared); Diag(PrevDestructor->getLocation(), - PrevDestructor->isThisDeclarationADefinition()? - diag::err_previous_definition - : diag::err_previous_declaration); + PrevDestructor->isThisDeclarationADefinition() ? + diag::note_previous_definition + : diag::note_previous_declaration); Destructor->setInvalidDecl(); return Destructor; } @@ -1188,8 +1188,8 @@ Sema::DeclTy *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { Diag(Conversion->getLocation(), diag::err_conv_function_redeclared); Diag(OtherConv->getLocation(), OtherConv->isThisDeclarationADefinition()? - diag::err_previous_definition - : diag::err_previous_declaration); + diag::note_previous_definition + : diag::note_previous_declaration); Conversion->setInvalidDecl(); return (DeclTy *)Conversion; } @@ -1272,7 +1272,7 @@ Sema::DeclTy *Sema::ActOnStartNamespaceDef(Scope *NamespcScope, // This is an invalid name redefinition. Diag(Namespc->getLocation(), diag::err_redefinition_different_kind) << Namespc->getDeclName(); - Diag(PrevDecl->getLocation(), diag::err_previous_definition); + Diag(PrevDecl->getLocation(), diag::note_previous_definition); Namespc->setInvalidDecl(); // Continue on to push Namespc as current DeclContext and return it. } |