]> granicus.if.org Git - clang/commitdiff
Tests for CWG issue 165-170.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 7 Nov 2013 19:26:14 +0000 (19:26 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 7 Nov 2013 19:26:14 +0000 (19:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194215 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/drs/dr1xx.cpp
www/cxx_dr_status.html

index 646bc1b5ce97c2ec49680529ca0b6e4254b42728..e06034b8d95fab5d1dcad453cddc33588bbda884 100644 (file)
@@ -670,3 +670,57 @@ namespace dr165 { // dr165: no
   // FIXME: dr165 says this is ill-formed, but the argument in dr1477 says it's ok
   void N::g() {}
 }
+
+namespace dr166 { // dr166: yes
+  namespace A { class X; }
+
+  template<typename T> int f(T t) { return t.n; }
+  int g(A::X);
+  template<typename T> int h(T t) { return t.n; } // expected-error {{private}}
+  int i(A::X);
+
+  namespace A {
+    class X {
+      friend int f<X>(X);
+      friend int dr166::g(X);
+      friend int h(X);
+      friend int i(X);
+      int n; // expected-note 2{{here}}
+    };
+
+    int h(X x) { return x.n; }
+    int i(X x) { return x.n; }
+  }
+
+  template int f(A::X);
+  int g(A::X x) { return x.n; }
+  template int h(A::X); // expected-note {{instantiation}}
+  int i(A::X x) { return x.n; } // expected-error {{private}}
+}
+
+// dr167: sup 1012
+
+namespace dr168 { // dr168: no
+  extern "C" typedef int (*p)();
+  extern "C++" typedef int (*q)();
+  struct S {
+    static int f();
+  };
+  p a = &S::f; // FIXME: this should fail.
+  q b = &S::f;
+}
+
+namespace dr169 { // dr169: yes
+  template<typename> struct A { int n; };
+  struct B {
+    template<typename> struct C;
+    template<typename> void f();
+    template<typename> static int n; // expected-error 0-1{{extension}}
+  };
+  struct D : A<int>, B {
+    using A<int>::n;
+    using B::C<int>; // expected-error {{using declaration can not refer to a template specialization}}
+    using B::f<int>; // expected-error {{using declaration can not refer to a template specialization}}
+    using B::n<int>; // expected-error {{using declaration can not refer to a template specialization}}
+  };
+}
index 8c4bde8eadc634c7992f319c6a8b1a48246676f5..42d0cb998521bf4ec6dce1cd2269ee56dc4308f7 100644 (file)
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#166">166</a></td>
     <td>TC1</td>
     <td>Friend declarations of <I>template-id</I>s</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#167">167</a></td>
     <td>NAD</td>
     <td>Deprecating static functions</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">Superseded by 1012</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#168">168</a></td>
     <td>NAD</td>
     <td>C linkage for static member functions</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#169">169</a></td>
     <td>NAD</td>
     <td><I>template-id</I>s in <I>using-declaration</I>s</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr class="open">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#170">170</a></td>