From 8c44db50d646ae0d42c6473e096934c72fecdfd5 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Mon, 6 Jan 2014 11:31:06 +0000 Subject: Diagnose enum redeclarations properly In all three checks, the note indicates a previous declaration and never a 'use'. Before: enum-scoped.cpp:92:6: note: previous use is here enum Redeclare6 : int; ^ After: enum-scoped.cpp:92:6: note: previous declaration is here enum Redeclare6 : int; ^ llvm-svn: 198600 --- clang/lib/Sema/SemaDecl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index bdb8bbac72a..c17510ae8a7 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -10248,7 +10248,7 @@ bool Sema::CheckEnumRedeclaration(SourceLocation EnumLoc, bool IsScoped, if (IsScoped != Prev->isScoped()) { Diag(EnumLoc, diag::err_enum_redeclare_scoped_mismatch) << Prev->isScoped(); - Diag(Prev->getLocation(), diag::note_previous_use); + Diag(Prev->getLocation(), diag::note_previous_declaration); return true; } @@ -10259,13 +10259,13 @@ bool Sema::CheckEnumRedeclaration(SourceLocation EnumLoc, bool IsScoped, Prev->getIntegerType())) { Diag(EnumLoc, diag::err_enum_redeclare_type_mismatch) << EnumUnderlyingTy << Prev->getIntegerType(); - Diag(Prev->getLocation(), diag::note_previous_use); + Diag(Prev->getLocation(), diag::note_previous_declaration); return true; } } else if (IsFixed != Prev->isFixed()) { Diag(EnumLoc, diag::err_enum_redeclare_fixed_mismatch) << Prev->isFixed(); - Diag(Prev->getLocation(), diag::note_previous_use); + Diag(Prev->getLocation(), diag::note_previous_declaration); return true; } -- cgit v1.2.3