Parsing and AST representation for dependent template names that occur
within nested-name-specifiers, e.g., for the "apply" in

  typename MetaFun::template apply<T1, T2>::type

At present, we can't instantiate these nested-name-specifiers, so our
testing is sketchy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68081 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/metafun-apply.cpp b/test/SemaTemplate/metafun-apply.cpp
new file mode 100644
index 0000000..22be5ab
--- /dev/null
+++ b/test/SemaTemplate/metafun-apply.cpp
@@ -0,0 +1,29 @@
+// RUN: clang-cc -fsyntax-only %s
+
+struct add_pointer {
+  template<typename T>
+  struct apply {
+    typedef T* type;
+  };
+};
+
+struct add_reference {
+  template<typename T>
+  struct apply {
+    typedef T& type;
+  };
+};
+
+template<typename MetaFun, typename T>
+struct apply1 {
+  typedef typename MetaFun::template apply<T>::type type;
+};
+
+#if 0
+// FIXME: The code below requires template instantiation for dependent
+// template-names that occur within nested-name-specifiers.
+int i;
+
+apply1<add_pointer, int>::type ip = &i;
+apply1<add_reference, int>::type ir = i;
+#endif