diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-06 11:31:06 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-06 11:31:06 +0000 |
commit | fe945a37b5d700acf4ef264b6e2c4ab43d771b46 (patch) | |
tree | e2cceff21e5cda89b5c1f7a853919fad89029495 /lib | |
parent | 5e3c8acfedc7726810bf376bc8e32c8c686fc3a3 (diff) | |
download | clang-fe945a37b5d700acf4ef264b6e2c4ab43d771b46.tar.gz |
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;
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index bdb8bbac72..c17510ae8a 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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; } |