[Sema] Emit a better diagnostic when variable redeclarations disagree
We referred to all declaration in definitions in our diagnostic messages
which is can be inaccurate. Instead, classify the declaration and emit
an appropriate diagnostic for the new declaration and an appropriate
note pointing to the old one.
This fixes PR24116.
llvm-svn: 242190
diff --git a/clang/test/SemaCXX/array-bound-merge.cpp b/clang/test/SemaCXX/array-bound-merge.cpp
index c6085fb..a360d00 100644
--- a/clang/test/SemaCXX/array-bound-merge.cpp
+++ b/clang/test/SemaCXX/array-bound-merge.cpp
@@ -10,5 +10,5 @@
int d[1][]; // expected-error {{array has incomplete element type 'int []'}}
-extern const int e[2]; // expected-note {{previous definition is here}}
+extern const int e[2]; // expected-note {{previous declaration is here}}
int e[] = { 1 }; // expected-error {{redefinition of 'e' with a different type: 'int []' vs 'const int [2]'}}