[cfe-commits] r91153 - /cfe/trunk/test/SemaTemplate/friend-template.cpp

John McCall rjmccall at apple.com
Fri Dec 11 12:51:23 PST 2009


Author: rjmccall
Date: Fri Dec 11 14:51:23 2009
New Revision: 91153

URL: http://llvm.org/viewvc/llvm-project?rev=91153&view=rev
Log:
Reorganize testcase.


Modified:
    cfe/trunk/test/SemaTemplate/friend-template.cpp

Modified: cfe/trunk/test/SemaTemplate/friend-template.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/friend-template.cpp?rev=91153&r1=91152&r2=91153&view=diff

==============================================================================
--- cfe/trunk/test/SemaTemplate/friend-template.cpp (original)
+++ cfe/trunk/test/SemaTemplate/friend-template.cpp Fri Dec 11 14:51:23 2009
@@ -1,23 +1,20 @@
 // RUN: clang-cc -fsyntax-only -verify %s
 
 // PR5057
-namespace std {
-  class X {
-  public:
-    template<typename T>
-    friend struct Y;
-  };
-}
-
-namespace std {
-  template<typename T>
-  struct Y
-  {
-  };
+namespace test0 {
+  namespace std {
+    class X {
+    public:
+      template<typename T> friend struct Y;
+    };
+  }
+
+  namespace std {
+    template<typename T> struct Y {};
+  }
 }
 
-
-namespace N {
+namespace test1 {
   template<typename T> void f1(T) { } // expected-note{{here}}
 
   class X {
@@ -30,64 +27,58 @@
 }
 
 // PR4768
-template<typename T>
-struct X0 {
-  template<typename U> friend struct X0;
-};
-
-template<typename T>
-struct X0<T*> {
-  template<typename U> friend struct X0;
-};
-
-template<>
-struct X0<int> {
-  template<typename U> friend struct X0;
-};
-
-template<typename T>
-struct X1 {
-  template<typename U> friend void f2(U);
-  template<typename U> friend void f3(U);
-};
-
-template<typename U> void f2(U);
-
-X1<int> x1i;
-X0<int*> x0ip;
-
-template<> void f2(int);
-
-// FIXME: Should this declaration of f3 be required for the specialization of
-// f3<int> (further below) to work? GCC and EDG don't require it, we do...
-template<typename U> void f3(U);
+namespace test2 {
+  template<typename T> struct X0 {
+    template<typename U> friend struct X0;
+  };
+  
+  template<typename T> struct X0<T*> {
+    template<typename U> friend struct X0;
+  };
 
-template<> void f3(int);
+  template<> struct X0<int> {
+    template<typename U> friend struct X0;
+  };
 
-// PR5332
-template <typename T>
-class Foo {
-  template <typename U>
-  friend class Foo;
-};
+  template<typename T> struct X1 {
+    template<typename U> friend void f2(U);
+    template<typename U> friend void f3(U);
+  };
 
-Foo<int> foo;
+  template<typename U> void f2(U);
 
-template<typename T, T Value>
-struct X2a;
+  X1<int> x1i;
+  X0<int*> x0ip;
 
-template<typename T, int Size>
-struct X2b;
+  template<> void f2(int);
 
-template<typename T>
-class X3 {
-  template<typename U, U Value>
-  friend struct X2a;
+  // FIXME: Should this declaration of f3 be required for the specialization of
+  // f3<int> (further below) to work? GCC and EDG don't require it, we do...
+  template<typename U> void f3(U);
 
-  template<typename U, T Value>
-  friend struct X2b;
-};
+  template<> void f3(int);
+}
+
+// PR5332
+namespace test3 {
+  template <typename T> class Foo {
+    template <typename U>
+    friend class Foo;
+  };
+
+  Foo<int> foo;
+
+  template<typename T, T Value> struct X2a;
 
-X3<int> x3i; // okay
+  template<typename T, int Size> struct X2b;
 
-X3<long> x3l; // FIXME: should cause an instantiation-time failure
+  template<typename T>
+  class X3 {
+    template<typename U, U Value> friend struct X2a;
+    template<typename U, T Value> friend struct X2b;
+  };
+
+  X3<int> x3i; // okay
+
+  X3<long> x3l; // FIXME: should cause an instantiation-time failure
+}





More information about the cfe-commits mailing list