Don't automatically assume that an id-expression refers to a
ValueDecl, because that isn't always the case in ill-formed
code. Diagnose a common mistake (forgetting to provide a template
argument list for a class template, PR5655) and dyn_cast so that we
handle the general problem of referring to a non-value declaration
gracefully.

llvm-svn: 90239
diff --git a/clang/test/SemaCXX/attr-cxx0x.cpp b/clang/test/SemaCXX/attr-cxx0x.cpp
index da52d33..d68779c 100644
--- a/clang/test/SemaCXX/attr-cxx0x.cpp
+++ b/clang/test/SemaCXX/attr-cxx0x.cpp
@@ -2,7 +2,7 @@
 
 int final_fail [[final]]; //expected-error {{'final' attribute only applies to virtual method or class types}}
 
-struct [[final]] final_base { }; // expected-note {{struct final_base declared here}}
+struct [[final]] final_base { }; // expected-note {{'struct final_base' declared here}}
 struct final_child : final_base { }; // expected-error {{derivation from 'final' struct final_base}}
 
 struct final_member { virtual void quux [[final]] (); }; // expected-note {{overridden virtual function is here}}
@@ -33,4 +33,4 @@
 };
 
 struct [[base_check, base_check]] bc : base { // expected-error {{'base_check' attribute cannot be repeated}}
-};
\ No newline at end of file
+};
diff --git a/clang/test/SemaTemplate/class-template-id.cpp b/clang/test/SemaTemplate/class-template-id.cpp
index e74a6f8..98ccbe7 100644
--- a/clang/test/SemaTemplate/class-template-id.cpp
+++ b/clang/test/SemaTemplate/class-template-id.cpp
@@ -36,3 +36,8 @@
 
 N::C<int> c1;
 typedef N::C<float> c2;
+
+// PR5655
+template<typename T> struct Foo { }; // expected-note{{template is declared here}}
+
+void f(void) { Foo bar; } // expected-error{{without a template argument list}}