Index: test/CXX/class.access/class.friend/p3-cxx0x.cpp
===================================================================
--- test/CXX/class.access/class.friend/p3-cxx0x.cpp	(revision 174258)
+++ test/CXX/class.access/class.friend/p3-cxx0x.cpp	(working copy)
@@ -28,14 +28,19 @@
 X1<Y3> x1b;
 X1<Y1> x1c; // expected-note{{in instantiation of template class 'X1<Y1>' requested here}}
 
+template<typename T> class B;
+
 template<typename T>
 class A {
   T x;
 public:
   class foo {};
   static int y;
+  template <typename S> friend class B<S>::ty;
 };
 
+template <typename T> class B { typedef int ty; };
+
 struct {
   // Ill-formed
   int friend; // expected-error {{'friend' must appear first in a non-function declaration}}
@@ -53,3 +58,5 @@
   float;
   template<typename T> friend class A<T>::foo;
 } a;
+
+void testA() { (void)sizeof(A<int>); }
