Don't complain about useless user-defined conversion functions when
they were instantiated from a template. In template metaprogramming,
stuff happens. Fixes PR8065.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113722 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/conversion-function.cpp b/test/SemaCXX/conversion-function.cpp
index 7f8fdd5..8d5e010 100644
--- a/test/SemaCXX/conversion-function.cpp
+++ b/test/SemaCXX/conversion-function.cpp
@@ -325,3 +325,21 @@
     int i = ed;
   }
 }
+
+namespace PR8065 {
+  template <typename T> struct Iterator;
+  template <typename T> struct Container;
+
+  template<>
+  struct Iterator<int> {
+    typedef Container<int> container_type;
+  };
+
+  template <typename T>
+  struct Container {
+    typedef typename Iterator<T>::container_type X;
+    operator X(void) { return X(); }
+  };
+
+  Container<int> test;
+}