r194215 - Tests for CWG issue 165-170.

Richard Smith richard-llvm at metafoo.co.uk
Thu Nov 7 11:26:15 PST 2013


Author: rsmith
Date: Thu Nov  7 13:26:14 2013
New Revision: 194215

URL: http://llvm.org/viewvc/llvm-project?rev=194215&view=rev
Log:
Tests for CWG issue 165-170.

Modified:
    cfe/trunk/test/CXX/drs/dr1xx.cpp
    cfe/trunk/www/cxx_dr_status.html

Modified: cfe/trunk/test/CXX/drs/dr1xx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr1xx.cpp?rev=194215&r1=194214&r2=194215&view=diff
==============================================================================
--- cfe/trunk/test/CXX/drs/dr1xx.cpp (original)
+++ cfe/trunk/test/CXX/drs/dr1xx.cpp Thu Nov  7 13:26:14 2013
@@ -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}}
+  };
+}

Modified: cfe/trunk/www/cxx_dr_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_dr_status.html?rev=194215&r1=194214&r2=194215&view=diff
==============================================================================
--- cfe/trunk/www/cxx_dr_status.html (original)
+++ cfe/trunk/www/cxx_dr_status.html Thu Nov  7 13:26:14 2013
@@ -1034,25 +1034,25 @@
     <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>





More information about the cfe-commits mailing list