Index: include/clang/Basic/DiagnosticParseKinds.td
===================================================================
--- include/clang/Basic/DiagnosticParseKinds.td	(revision 189305)
+++ include/clang/Basic/DiagnosticParseKinds.td	(working copy)
@@ -305,6 +305,8 @@
 def err_expected_class_name : Error<"expected class name">;
 def err_expected_class_name_not_template : 
   Error<"'typename' is redundant; base classes are implicitly types">;
+def err_expected_template_arguments :
+  Error<"expected template argument list after template-id">;
 def err_unspecified_vla_size_with_static : Error<
   "'static' may not be used with an unspecified variable length array size">;
 def warn_deprecated_register : Warning<
Index: lib/Parse/ParseDeclCXX.cpp
===================================================================
--- lib/Parse/ParseDeclCXX.cpp	(revision 189305)
+++ lib/Parse/ParseDeclCXX.cpp	(working copy)
@@ -960,7 +960,18 @@
                                         /*NonTrivialTypeSourceInfo=*/true,
                                         &CorrectedII);
   if (!Type) {
-    Diag(IdLoc, diag::err_expected_class_name);
+    UnqualifiedId TemplateName;
+    TemplateName.setIdentifier(Id, IdLoc);
+    TemplateTy Template;
+    bool MemberOfUnknownSpecialization;
+    if (Actions.isTemplateName(getCurScope(), SS, /*hasTemplateKeyword=*/false,
+                               TemplateName, ParsedType(),
+                               /*EnteringContext=*/false, Template,
+                               MemberOfUnknownSpecialization)) {
+      Diag(IdLoc, diag::err_expected_template_arguments);
+    } else {
+      Diag(IdLoc, diag::err_expected_class_name);
+    }
     return true;
   }
 
Index: test/Parser/cxx-class.cpp
===================================================================
--- test/Parser/cxx-class.cpp	(revision 189305)
+++ test/Parser/cxx-class.cpp	(working copy)
@@ -113,6 +113,11 @@
   }
 }
 
+namespace PR8382 {
+  template <class T> class Foo {};
+  class Bar : public Foo {};  // expected-error {{expected template argument list after template-id}}
+}
+
 // PR11109 must appear at the end of the source file
 class pr11109r3 { // expected-note{{to match this '{'}}
   public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}}
