PR12585: When processing a friend template inside a class template, don't
pretend there was no previous declaration -- that can lead us to injecting
a class template (with no access specifier) into a class scope. Instead,
just avoid the problematic checks.

llvm-svn: 155303
diff --git a/clang/test/PCH/cxx-friends.cpp b/clang/test/PCH/cxx-friends.cpp
index a8d7558..bdba42b 100644
--- a/clang/test/PCH/cxx-friends.cpp
+++ b/clang/test/PCH/cxx-friends.cpp
@@ -11,3 +11,11 @@
     a->x = 0;
   }
 };
+
+template<typename T> class PR12585::future_base::setter {
+public:
+  int f() {
+    return promise<T*>().k;
+  }
+};
+int k = PR12585::future_base::setter<int>().f();