Add note to help explain why a tag such as 'struct' is needed to refer
to a given type, when the reason is that there is a non-type decl with
the same name.

llvm-svn: 155677
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 38bb852..ec950d1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -564,6 +564,14 @@
         Diag(NameLoc, diag::err_use_of_tag_name_without_tag)
           << Name << TagName << getLangOpts().CPlusPlus
           << FixItHint::CreateInsertion(NameLoc, FixItTagName);
+
+        LookupResult R(*this, Name, NameLoc, LookupOrdinaryName);
+        if (LookupParsedName(R, S, &SS)) {
+          for (LookupResult::iterator I = R.begin(), IEnd = R.end();
+               I != IEnd; ++I)
+            Diag((*I)->getLocation(), diag::note_decl_shadowing_tag_type)
+              << Name << TagName;
+        }
         break;
       }