From: John McCall Date: Fri, 11 Dec 2009 20:51:23 +0000 (+0000) Subject: Reorganize testcase. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b6e90a0dd98b13c2d3ac34ee3eae3954dbb87c6;p=clang Reorganize testcase. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91153 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaTemplate/friend-template.cpp b/test/SemaTemplate/friend-template.cpp index 84a8e899db..f4fd6b8899 100644 --- a/test/SemaTemplate/friend-template.cpp +++ b/test/SemaTemplate/friend-template.cpp @@ -1,23 +1,20 @@ // RUN: clang-cc -fsyntax-only -verify %s // PR5057 -namespace std { - class X { - public: - template - friend struct Y; - }; +namespace test0 { + namespace std { + class X { + public: + template friend struct Y; + }; + } + + namespace std { + template struct Y {}; + } } -namespace std { - template - struct Y - { - }; -} - - -namespace N { +namespace test1 { template void f1(T) { } // expected-note{{here}} class X { @@ -30,64 +27,58 @@ namespace N { } // PR4768 -template -struct X0 { - template friend struct X0; -}; - -template -struct X0 { - template friend struct X0; -}; +namespace test2 { + template struct X0 { + template friend struct X0; + }; + + template struct X0 { + template friend struct X0; + }; -template<> -struct X0 { - template friend struct X0; -}; + template<> struct X0 { + template friend struct X0; + }; -template -struct X1 { - template friend void f2(U); - template friend void f3(U); -}; + template struct X1 { + template friend void f2(U); + template friend void f3(U); + }; -template void f2(U); + template void f2(U); -X1 x1i; -X0 x0ip; + X1 x1i; + X0 x0ip; -template<> void f2(int); + template<> void f2(int); -// FIXME: Should this declaration of f3 be required for the specialization of -// f3 (further below) to work? GCC and EDG don't require it, we do... -template void f3(U); + // FIXME: Should this declaration of f3 be required for the specialization of + // f3 (further below) to work? GCC and EDG don't require it, we do... + template void f3(U); -template<> void f3(int); + template<> void f3(int); +} // PR5332 -template -class Foo { - template - friend class Foo; -}; - -Foo foo; +namespace test3 { + template class Foo { + template + friend class Foo; + }; -template -struct X2a; + Foo foo; -template -struct X2b; + template struct X2a; -template -class X3 { - template - friend struct X2a; + template struct X2b; - template - friend struct X2b; -}; + template + class X3 { + template friend struct X2a; + template friend struct X2b; + }; -X3 x3i; // okay + X3 x3i; // okay -X3 x3l; // FIXME: should cause an instantiation-time failure + X3 x3l; // FIXME: should cause an instantiation-time failure +}