r194951 - Tests for core issue 241-250.

Richard Smith richard-llvm at metafoo.co.uk
Sat Nov 16 22:39:44 PST 2013


Author: rsmith
Date: Sun Nov 17 00:39:43 2013
New Revision: 194951

URL: http://llvm.org/viewvc/llvm-project?rev=194951&view=rev
Log:
Tests for core issue 241-250.

Modified:
    cfe/trunk/test/CXX/drs/dr0xx.cpp
    cfe/trunk/test/CXX/drs/dr2xx.cpp
    cfe/trunk/www/cxx_dr_status.html
    cfe/trunk/www/make_cxx_dr_status

Modified: cfe/trunk/test/CXX/drs/dr0xx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr0xx.cpp?rev=194951&r1=194950&r2=194951&view=diff
==============================================================================
--- cfe/trunk/test/CXX/drs/dr0xx.cpp (original)
+++ cfe/trunk/test/CXX/drs/dr0xx.cpp Sun Nov 17 00:39:43 2013
@@ -325,7 +325,7 @@ namespace dr29 { // dr29: 3.4
   }
 }
 
-namespace dr30 { // dr30: sup 468
+namespace dr30 { // dr30: sup 468 c++11
   struct A {
     template<int> static int f();
   } a, *p = &a;

Modified: cfe/trunk/test/CXX/drs/dr2xx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr2xx.cpp?rev=194951&r1=194950&r2=194951&view=diff
==============================================================================
--- cfe/trunk/test/CXX/drs/dr2xx.cpp (original)
+++ cfe/trunk/test/CXX/drs/dr2xx.cpp Sun Nov 17 00:39:43 2013
@@ -405,3 +405,126 @@ namespace dr239 { // dr239: yes
 }
 
 // dr240: dup 616
+
+namespace dr241 { // dr241: yes
+  namespace A {
+    struct B {};
+    template <int X> void f(); // expected-note 2{{candidate}}
+    template <int X> void g(B);
+  }
+  namespace C {
+    template <class T> void f(T t); // expected-note 2{{candidate}}
+    template <class T> void g(T t); // expected-note {{candidate}}
+  }
+  void h(A::B b) {
+    f<3>(b); // expected-error {{undeclared identifier}}
+    g<3>(b); // expected-error {{undeclared identifier}}
+    A::f<3>(b); // expected-error {{no matching}}
+    A::g<3>(b);
+    C::f<3>(b); // expected-error {{no matching}}
+    C::g<3>(b); // expected-error {{no matching}}
+    using C::f;
+    using C::g;
+    f<3>(b); // expected-error {{no matching}}
+    g<3>(b);
+  }
+}
+
+namespace dr243 { // dr243: yes
+  struct B;
+  struct A {
+    A(B); // expected-note {{candidate}}
+  };
+  struct B {
+    operator A() = delete; // expected-error 0-1{{extension}} expected-note {{candidate}}
+  } b;
+  A a1(b);
+  A a2 = b; // expected-error {{ambiguous}}
+}
+
+namespace dr244 { // dr244: no
+  struct B {}; struct D : B {}; // expected-note {{here}}
+
+  D D_object;
+  typedef B B_alias;
+  B* B_ptr = &D_object;
+
+  void f() {
+    D_object.~B(); // expected-error {{expression does not match the type}}
+    D_object.B::~B();
+    B_ptr->~B();
+    B_ptr->~B_alias();
+    B_ptr->B_alias::~B();
+    // This is valid under DR244.
+    B_ptr->B_alias::~B_alias(); // FIXME: expected-error {{expected the class name after '~' to name a destructor}}
+    B_ptr->dr244::~B(); // expected-error {{refers to a member in namespace}}
+    B_ptr->dr244::~B_alias(); // expected-error {{refers to a member in namespace}}
+  }
+}
+
+namespace dr245 { // dr245: yes
+  struct S {
+    enum E {}; // expected-note {{here}}
+    class E *p; // expected-error {{does not match previous declaration}}
+  };
+}
+
+namespace dr246 { // dr246: yes
+  struct S {
+    S() try { // expected-note {{try block}}
+      throw 0;
+X: ;
+    } catch (int) {
+      goto X; // expected-error {{protected scope}}
+    }
+  };
+}
+
+namespace dr247 { // dr247: yes
+  struct A {};
+  struct B : A {
+    void f();
+    void f(int);
+  };
+  void (A::*f)() = (void (A::*)())&B::f;
+
+  struct C {
+    void f();
+    void f(int);
+  };
+  struct D : C {};
+  void (C::*g)() = &D::f;
+  void (D::*h)() = &D::f;
+
+  struct E {
+    void f();
+  };
+  struct F : E {
+    using E::f;
+    void f(int);
+  };
+  void (F::*i)() = &F::f;
+}
+
+namespace dr248 { // dr248: yes c++11
+  // FIXME: Should this also apply to c++98 mode? This was a DR against C++98.
+  int \u040d\u040e = 0;
+#if __cplusplus < 201103L
+  // FIXME: expected-error at -2 {{expected ';'}}
+#endif
+}
+
+namespace dr249 { // dr249: yes
+  template<typename T> struct X { void f(); };
+  template<typename T> void X<T>::f() {}
+}
+
+namespace dr250 { // dr250: yes
+  typedef void (*FPtr)(double x[]);
+
+  template<int I> void f(double x[]);
+  FPtr fp = &f<3>;
+
+  template<int I = 3> void g(double x[]); // expected-error 0-1{{extension}}
+  FPtr gp = &g<>;
+}

Modified: cfe/trunk/www/cxx_dr_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_dr_status.html?rev=194951&r1=194950&r2=194951&view=diff
==============================================================================
--- cfe/trunk/www/cxx_dr_status.html (original)
+++ cfe/trunk/www/cxx_dr_status.html Sun Nov 17 00:39:43 2013
@@ -218,7 +218,7 @@
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#30">30</a></td>
     <td>TC1</td>
     <td>Valid uses of "<TT>::template</TT>"</td>
-    <td class="none" align="center">Superseded by 468</td>
+    <td class="none" align="center">Superseded by 468 (C++11 onwards)</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#31">31</a></td>
@@ -1485,7 +1485,7 @@ accessible?</td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#241">241</a></td>
     <td>TC1</td>
     <td>Error in example in 14.8.1</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#242">242</a></td>
@@ -1497,49 +1497,49 @@ accessible?</td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#243">243</a></td>
     <td>NAD</td>
     <td>Weighting of conversion functions in direct-initialization</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_defects.html#244">244</a></td>
     <td>CD1</td>
     <td>Destructor lookup</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_defects.html#245">245</a></td>
     <td>CD1</td>
     <td>Name lookup in <I>elaborated-type-specifier</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_defects.html#246">246</a></td>
     <td>CD1</td>
     <td>Jumps in <I>function-try-block</I> handlers</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#247">247</a></td>
     <td>NAD</td>
     <td>Pointer-to-member casts and function overload resolution</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_defects.html#248">248</a></td>
     <td>FDIS</td>
     <td>Identifier characters</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes (C++11 onwards)</td>
   </tr>
   <tr>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#249">249</a></td>
     <td>TC1</td>
     <td>What is a member function template?</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_defects.html#250">250</a></td>
     <td>TC1</td>
     <td>Address of function template specialization with non-deduced template arguments</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#251">251</a></td>

Modified: cfe/trunk/www/make_cxx_dr_status
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/make_cxx_dr_status?rev=194951&r1=194950&r2=194951&view=diff
==============================================================================
--- cfe/trunk/www/make_cxx_dr_status (original)
+++ cfe/trunk/www/make_cxx_dr_status Sun Nov 17 00:39:43 2013
@@ -94,6 +94,10 @@ print >> out_file, '''\
 
 def availability(issue):
   status = status_map.get(issue, 'unknown')
+  avail_suffix = ''
+  if status.endswith(' c++11'):
+    status = status[:-6]
+    avail_suffix = ' (C++11 onwards)'
   if status == 'unknown':
     avail = 'Unknown'
     avail_style = ' class="none"'
@@ -129,7 +133,7 @@ def availability(issue):
     _, avail_style = availability(dup)
   else:
     assert False, 'unknown status %s for issue %s' % (status, dr.issue)
-  return (avail, avail_style)
+  return (avail + avail_suffix, avail_style)
 
 count = {}
 for dr in drs:





More information about the cfe-commits mailing list