Add some more code modification hints

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68261 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index abc3ac0..d30726c 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -462,12 +462,14 @@
     //   template declaration (7.1.5.3).
     RecordDecl *PrevRecordDecl = PrevClassTemplate->getTemplatedDecl();
     if (PrevRecordDecl->getTagKind() != Kind) {
-      Diag(KWLoc, diag::err_use_with_wrong_tag) << Name;
+      Diag(KWLoc, diag::err_use_with_wrong_tag) 
+        << Name
+        << CodeModificationHint::CreateReplacement(KWLoc, 
+                            PrevRecordDecl->getKindName());
       Diag(PrevRecordDecl->getLocation(), diag::note_previous_use);
-      return true;
+      Kind = PrevRecordDecl->getTagKind();
     }
 
-
     // Check for redefinition of this class template.
     if (TK == TK_Definition) {
       if (TagDecl *Def = PrevRecordDecl->getDefinition(Context)) {
@@ -1974,7 +1976,10 @@
   case DeclSpec::TST_class:  Kind = TagDecl::TK_class; break;
   }
   if (ClassTemplate->getTemplatedDecl()->getTagKind() != Kind) {
-    Diag(KWLoc, diag::err_use_with_wrong_tag) << ClassTemplate;
+    Diag(KWLoc, diag::err_use_with_wrong_tag) 
+      << ClassTemplate
+      << CodeModificationHint::CreateReplacement(KWLoc, 
+                            ClassTemplate->getTemplatedDecl()->getKindName());
     Diag(ClassTemplate->getTemplatedDecl()->getLocation(), 
          diag::note_previous_use);
     Kind = ClassTemplate->getTemplatedDecl()->getTagKind();