summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-09-15 22:56:03 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-09-15 22:56:03 +0000
commit788bd00c123e46de5a3896c4dc3a6389a1bb1d3f (patch)
tree25a04dc22d1571a8fad3e6363c749b0f1e96bead
parente2c70b3a5aca4fc7b28cf965e792222d60834b6a (diff)
Tests for DR581-600.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217844 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CXX/drs/dr5xx.cpp140
-rw-r--r--www/cxx_dr_status.html32
2 files changed, 156 insertions, 16 deletions
diff --git a/test/CXX/drs/dr5xx.cpp b/test/CXX/drs/dr5xx.cpp
index 770e32278f..3872295d03 100644
--- a/test/CXX/drs/dr5xx.cpp
+++ b/test/CXX/drs/dr5xx.cpp
@@ -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;
+ }
+}
diff --git a/www/cxx_dr_status.html b/www/cxx_dr_status.html
index 3ae5fc1473..96b593aa68 100644
--- a/www/cxx_dr_status.html
+++ b/www/cxx_dr_status.html
@@ -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 &#8220;current instantiation&#8221;</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>