[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/Sema/struct-compat.c b/clang/test/Sema/struct-compat.c
index 65bef9f..68bb2ca 100644
--- a/clang/test/Sema/struct-compat.c
+++ b/clang/test/Sema/struct-compat.c
@@ -1,8 +1,8 @@
 /* RUN: %clang_cc1 %s -fsyntax-only -pedantic -verify
  */
 
-extern struct {int a;} x; // expected-note {{previous definition is here}}
-extern struct {int a;} x; // expected-error {{redefinition of 'x'}}
+extern struct {int a;} x; // expected-note {{previous declaration is here}}
+extern struct {int a;} x; // expected-error {{redeclaration of 'x'}}
 
 struct x;
 int a(struct x* b) {