1*67e74705SXin Li // RUN: %clang_cc1 %s 2*67e74705SXin Li 3*67e74705SXin Li template <typename T> 4*67e74705SXin Li struct Foo { 5*67e74705SXin Li template <typename U> 6*67e74705SXin Li struct Bar {}; 7*67e74705SXin Li 8*67e74705SXin Li // The templated declaration for class Bar should not be instantiated when 9*67e74705SXin Li // Foo<int> is. This is to protect against PR5848; for now, this "parses" but 10*67e74705SXin Li // requires a rewrite of the templated friend code to be properly fixed. 11*67e74705SXin Li template <typename U> 12*67e74705SXin Li friend struct Bar; 13*67e74705SXin Li }; 14*67e74705SXin Li 15*67e74705SXin Li Foo<int> x; 16