Representation of template type parameters and non-type template
parameters, with some semantic analysis:
  - Template parameters are introduced into template parameter scope
  - Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates. 

Next up: dependent types and value-dependent/type-dependent
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60597 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp
index e415ba1..bcf05fc 100644
--- a/test/Parser/cxx-template-decl.cpp
+++ b/test/Parser/cxx-template-decl.cpp
@@ -41,9 +41,33 @@
 template <unsigned int N = 12u> NTP4;;
 template <unsigned int = 12u> NTP5;
 template <unsigned = 15u> NTP6;
-template <typename T, T Obj> NTP7;      // expected-error {{parse error}}
+template <typename T, T Obj> NTP7;
 
 // Template class declarations
 template <typename T> struct A { };
 template <typename T, typename U> struct B { };
 
+// Template parameter shadowing
+template<typename T, // expected-note{{template parameter is declared here}}
+	 typename T> // expected-error{{declaration of 'T' shadows template parameter}}
+  void shadow1();
+
+template<typename T> // expected-note{{template parameter is declared here}}
+void shadow2(int T); // expected-error{{declaration of 'T' shadows template parameter}}
+
+template<typename T> // expected-note{{template parameter is declared here}}
+class T { // expected-error{{declaration of 'T' shadows template parameter}}
+};
+
+template<int Size> // expected-note{{template parameter is declared here}}
+void shadow3(int Size); // expected-error{{declaration of 'Size' shadows template parameter}}
+
+// Non-type template parameters in scope
+template<int Size> 
+void f(int& i) {
+  i = Size;
+  Size = i; // expected-error{{expression is not assignable}}
+}
+
+template<typename T>
+const T& min(const T&, const T&);