r217844 - Tests for DR581-600.

Richard Smith richard-llvm at metafoo.co.uk
Mon Sep 15 15:56:03 PDT 2014


Author: rsmith
Date: Mon Sep 15 17:56:03 2014
New Revision: 217844

URL: http://llvm.org/viewvc/llvm-project?rev=217844&view=rev
Log:
Tests for DR581-600.

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

Modified: cfe/trunk/test/CXX/drs/dr5xx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr5xx.cpp?rev=217844&r1=217843&r2=217844&view=diff
==============================================================================
--- cfe/trunk/test/CXX/drs/dr5xx.cpp (original)
+++ cfe/trunk/test/CXX/drs/dr5xx.cpp Mon Sep 15 17:56:03 2014
@@ -852,3 +852,143 @@ namespace dr580 { // dr580: no
   C A::c;
   C B::c; // expected-error 2{{private}}
 }
+
+// dr582: na
+
+namespace dr583 { // dr583: no
+  // see n3624
+  int *p;
+  // FIXME: These are all ill-formed.
+  bool b1 = p < 0;
+  bool b2 = p > 0;
+  bool b3 = p <= 0;
+  bool b4 = p >= 0;
+}
+
+// dr584: na
+
+namespace dr585 { // dr585: yes
+  template<typename> struct T;
+  struct A {
+    friend T; // expected-error {{requires a type specifier}} expected-error {{can only be classes or functions}}
+    // FIXME: It's not clear whether the standard allows this or what it means,
+    // but the DR585 writeup suggests it as an alternative.
+    template<typename U> friend T<U>; // expected-error {{must use an elaborated type}}
+  };
+  template<template<typename> class T> struct B {
+    friend T; // expected-error {{requires a type specifier}} expected-error {{can only be classes or functions}}
+    template<typename U> friend T<U>; // expected-error {{must use an elaborated type}}
+  };
+}
+
+// dr586: na
+
+namespace dr587 { // dr587: yes
+  template<typename T> void f(bool b, const T x, T y) {
+    const T *p = &(b ? x : y);
+  }
+  struct S {};
+  template void f(bool, const int, int);
+  template void f(bool, const S, S);
+}
+
+namespace dr588 { // dr588: yes
+  struct A { int n; }; // expected-note {{ambiguous}}
+  template<typename T> int f() {
+    struct S : A, T { int f() { return n; } } s;
+    int a = s.f();
+    int b = s.n; // expected-error {{found in multiple}}
+  }
+  struct B { int n; }; // expected-note {{ambiguous}}
+  int k = f<B>(); // expected-note {{here}}
+}
+
+namespace dr589 { // dr589: yes
+  struct B { };
+  struct D : B { };
+  D f();
+  extern const B &b;
+  bool a;
+  const B *p = &(a ? f() : b); // expected-error {{temporary}}
+  const B *q = &(a ? D() : b); // expected-error {{temporary}}
+}
+
+namespace dr590 { // dr590: yes
+  template<typename T> struct A {
+    struct B {
+      struct C {
+        A<T>::B::C f(A<T>::B::C); // ok, no 'typename' required.
+      };
+    };
+  };
+  template<typename T> typename A<T>::B::C A<T>::B::C::f(A<T>::B::C) {}
+}
+
+namespace dr591 { // dr591: no
+  template<typename T> struct A {
+    typedef int M;
+    struct B {
+      typedef void M;
+      struct C;
+    };
+  };
+
+  template<typename T> struct A<T>::B::C : A<T> {
+    // FIXME: Should find member of non-dependent base class A<T>.
+    M m; // expected-error {{incomplete type 'M' (aka 'void'}}
+  };
+}
+
+// dr592: na
+// dr593 needs an IRGen test.
+// dr594: na
+
+namespace dr595 { // dr595: dup 1330
+  template<class T> struct X {
+    void f() throw(T) {}
+  };
+  struct S {
+    X<S> xs;
+  };
+}
+
+// dr597: na
+
+namespace dr598 { // dr598: yes
+  namespace N {
+    void f(int);
+    void f(char);
+    // Not found by ADL.
+    void g(void (*)(int));
+    void h(void (*)(int));
+
+    namespace M {
+      struct S {};
+      int &h(void (*)(S));
+    }
+    void i(M::S);
+    void i();
+  }
+  int &g(void(*)(char));
+  int &r = g(N::f);
+  int &s = h(N::f); // expected-error {{undeclared}}
+  int &t = h(N::i);
+}
+
+namespace dr599 { // dr599: partial
+  typedef int Fn();
+  struct S { operator void*(); };
+  struct T { operator Fn*(); };
+  struct U { operator int*(); operator void*(); }; // expected-note 2{{conversion}}
+  struct V { operator int*(); operator Fn*(); };
+  void f(void *p, void (*q)(), S s, T t, U u, V v) {
+    delete p; // expected-error {{cannot delete}}
+    delete q; // expected-error {{cannot delete}}
+    delete s; // expected-error {{cannot delete}}
+    delete t; // expected-error {{cannot delete}}
+    // FIXME: This is valid, but is rejected due to a non-conforming GNU
+    // extension allowing deletion of pointers to void.
+    delete u; // expected-error {{ambiguous}}
+    delete v;
+  }
+}

Modified: cfe/trunk/www/cxx_dr_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_dr_status.html?rev=217844&r1=217843&r2=217844&view=diff
==============================================================================
--- cfe/trunk/www/cxx_dr_status.html (original)
+++ cfe/trunk/www/cxx_dr_status.html Mon Sep 15 17:56:03 2014
@@ -3535,67 +3535,67 @@ and <I>POD class</I></td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#582">582</a></td>
     <td>CD1</td>
     <td>Template conversion functions</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="583">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#583">583</a></td>
     <td>CD3</td>
     <td>Relational pointer comparisons against the null pointer constant</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr id="584">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#584">584</a></td>
     <td>NAD</td>
     <td>Unions and aliasing</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="585">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#585">585</a></td>
     <td>NAD</td>
     <td>Friend template template parameters</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="586">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#586">586</a></td>
     <td>NAD</td>
     <td>Default <I>template-argument</I>s and template argument deduction</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="587">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#587">587</a></td>
     <td>CD2</td>
     <td>Lvalue operands of a conditional expression differing only in cv-qualification</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="588">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#588">588</a></td>
     <td>CD2</td>
     <td>Searching dependent bases of classes local to function templates</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="589">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#589">589</a></td>
     <td>CD2</td>
     <td>Direct binding of class and array rvalues in reference initialization</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="590">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#590">590</a></td>
     <td>C++11</td>
     <td>Nested classes and the “current instantiation”</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="591">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#591">591</a></td>
     <td>ready</td>
     <td>When a dependent base class is the current instantiation</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr id="592">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#592">592</a></td>
     <td>CD1</td>
     <td>Exceptions during construction of local static objects</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="593">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#593">593</a></td>
@@ -3607,13 +3607,13 @@ and <I>POD class</I></td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#594">594</a></td>
     <td>CD1</td>
     <td>Coordinating issues 119 and 404 with delegating constructors</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="595">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#595">595</a></td>
     <td>dup</td>
     <td>Exception specifications in templates instantiated from class bodies</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">Duplicate of <a href="#1330">1330</a></td>
   </tr>
   <tr class="open" id="596">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#596">596</a></td>
@@ -3625,19 +3625,19 @@ and <I>POD class</I></td>
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#597">597</a></td>
     <td>CD3</td>
     <td>Conversions applied to out-of-lifetime non-POD lvalues</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="598">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#598">598</a></td>
     <td>CD2</td>
     <td>Associated namespaces of overloaded functions and function templates</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="599">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#599">599</a></td>
     <td>CD2</td>
     <td>Deleting a null function pointer</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="partial" align="center">Partial</td>
   </tr>
   <tr class="open" id="600">
     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#600">600</a></td>





More information about the cfe-commits mailing list