summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-06 11:31:18 +0000
committerAlp Toker <alp@nuanti.com>2014-01-06 11:31:18 +0000
commitb9fa512954b1cd89958bdbd34b53329d6887e859 (patch)
treed6bcfd61fe41a3ec46aad42106f7d45973d9b79b /clang/lib/Sema/SemaDecl.cpp
parent8c44db50d646ae0d42c6473e096934c72fecdfd5 (diff)
downloadbcm5719-llvm-b9fa512954b1cd89958bdbd34b53329d6887e859.tar.gz
bcm5719-llvm-b9fa512954b1cd89958bdbd34b53329d6887e859.zip
Highlight the previous underlying enum type when diagnosing a mismatch
enum-scoped.cpp:93:6: error: enumeration redeclared with different underlying type 'short' (was 'int') enum Redeclare6 : short; ^ enum-scoped.cpp:92:6: note: previous declaration is here enum Redeclare6 : int; ^ ~~~ The redeclaration source range is still missing but this is a step forward, potentially edging towards a FixIt. llvm-svn: 198601
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index c17510ae8a7..07a551da2f1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -10257,9 +10257,11 @@ bool Sema::CheckEnumRedeclaration(SourceLocation EnumLoc, bool IsScoped,
!Prev->getIntegerType()->isDependentType() &&
!Context.hasSameUnqualifiedType(EnumUnderlyingTy,
Prev->getIntegerType())) {
+ // TODO: Highlight the underlying type of the redeclaration.
Diag(EnumLoc, diag::err_enum_redeclare_type_mismatch)
<< EnumUnderlyingTy << Prev->getIntegerType();
- Diag(Prev->getLocation(), diag::note_previous_declaration);
+ Diag(Prev->getLocation(), diag::note_previous_declaration)
+ << Prev->getIntegerTypeRange();
return true;
}
} else if (IsFixed != Prev->isFixed()) {
OpenPOWER on IntegriCloud