r194458 - Tests for core issue 201-215.
Richard Smith
richard-llvm at metafoo.co.uk
Tue Nov 12 01:16:17 PST 2013
Author: rsmith
Date: Tue Nov 12 03:16:15 2013
New Revision: 194458
URL: http://llvm.org/viewvc/llvm-project?rev=194458&view=rev
Log:
Tests for core issue 201-215.
Modified:
cfe/trunk/test/CXX/drs/dr2xx.cpp
cfe/trunk/www/cxx_dr_status.html
Modified: cfe/trunk/test/CXX/drs/dr2xx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/drs/dr2xx.cpp?rev=194458&r1=194457&r2=194458&view=diff
==============================================================================
--- cfe/trunk/test/CXX/drs/dr2xx.cpp (original)
+++ cfe/trunk/test/CXX/drs/dr2xx.cpp Tue Nov 12 03:16:15 2013
@@ -2,6 +2,12 @@
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+#if __cplusplus < 201103L
+#define fold(x) (__builtin_constant_p(x) ? (x) : (x))
+#else
+#define fold
+#endif
+
namespace dr200 { // dr200: dup 214
template <class T> T f(int);
template <class T, class U> T f(U) = delete; // expected-error 0-1{{extension}}
@@ -10,3 +16,98 @@ namespace dr200 { // dr200: dup 214
f<int>(1);
}
}
+
+// dr201 FIXME: write codegen test
+
+namespace dr202 { // dr202: yes
+ template<typename T> T f();
+ template<int (*g)()> struct X {
+ int arr[fold(g == &f<int>) ? 1 : -1];
+ };
+ template struct X<f>;
+}
+
+// FIXME (export) dr204: no
+
+namespace dr206 { // dr206: yes
+ struct S; // expected-note 2{{declaration}}
+ template<typename T> struct Q { S s; }; // expected-error {{incomplete}}
+ template<typename T> void f() { S s; } // expected-error {{incomplete}}
+}
+
+namespace dr207 { // dr207: yes
+ class A {
+ protected:
+ static void f() {}
+ };
+ class B : A {
+ public:
+ using A::f;
+ void g() {
+ A::f();
+ f();
+ }
+ };
+}
+
+// dr208 FIXME: write codegen test
+
+namespace dr209 { // dr209: yes
+ class A {
+ void f(); // expected-note {{here}}
+ };
+ class B {
+ friend void A::f(); // expected-error {{private}}
+ };
+}
+
+// dr210 FIXME: write codegen test
+
+namespace dr211 { // dr211: yes
+ struct A {
+ A() try {
+ throw 0;
+ } catch (...) {
+ return; // expected-error {{return in the catch of a function try block of a constructor}}
+ }
+ };
+}
+
+namespace dr213 { // dr213: yes
+ template <class T> struct A : T {
+ void h(T t) {
+ char &r1 = f(t);
+ int &r2 = g(t); // expected-error {{undeclared}}
+ }
+ };
+ struct B {
+ int &f(B);
+ int &g(B); // expected-note {{in dependent base class}}
+ };
+ char &f(B);
+
+ template void A<B>::h(B); // expected-note {{instantiation}}
+}
+
+namespace dr214 { // dr214: yes
+ template<typename T, typename U> T checked_cast(U from) { U::error; }
+ template<typename T, typename U> T checked_cast(U *from);
+ class C {};
+ void foo(int *arg) { checked_cast<const C *>(arg); }
+
+ template<typename T> T f(int);
+ template<typename T, typename U> T f(U) { T::error; }
+ void g() {
+ f<int>(1);
+ }
+}
+
+namespace dr215 { // dr215: yes
+ template<typename T> class X {
+ friend void T::foo();
+ int n;
+ };
+ struct Y {
+ void foo() { (void)+X<Y>().n; }
+ };
+}
Modified: cfe/trunk/www/cxx_dr_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_dr_status.html?rev=194458&r1=194457&r2=194458&view=diff
==============================================================================
--- cfe/trunk/www/cxx_dr_status.html (original)
+++ cfe/trunk/www/cxx_dr_status.html Tue Nov 12 03:16:15 2013
@@ -632,7 +632,7 @@
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#99">99</a></td>
<td>NAD</td>
<td>Partial ordering, references and cv-qualifiers</td>
- <td class="none" align="center">Superseded by 214</td>
+ <td class="full" align="center">Superseded by 214</td>
</tr>
<tr>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#100">100</a></td>
@@ -1238,7 +1238,7 @@
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#200">200</a></td>
<td>dup</td>
<td>Partial ordering and explicit arguments</td>
- <td class="none" align="center">Duplicate of 214</td>
+ <td class="full" align="center">Duplicate of 214</td>
</tr>
<tr>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#201">201</a></td>
@@ -1250,7 +1250,7 @@
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#202">202</a></td>
<td>TC1</td>
<td>Use of overloaded function name</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_closed.html#203">203</a></td>
@@ -1262,7 +1262,7 @@
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#204">204</a></td>
<td>CD1</td>
<td>Exported class templates</td>
- <td class="none" align="center">Unknown</td>
+ <td class="none" align="center">No</td>
</tr>
<tr class="open">
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#205">205</a></td>
@@ -1274,13 +1274,13 @@
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#206">206</a></td>
<td>TC1</td>
<td>Semantic constraints on non-dependent names</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#207">207</a></td>
<td>CD1</td>
<td><I>using-declaration</I>s and protected access</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#208">208</a></td>
@@ -1293,7 +1293,7 @@
<td>NAD</td>
<td>Must friend declaration names be
accessible?</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#210">210</a></td>
@@ -1305,7 +1305,7 @@ accessible?</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#211">211</a></td>
<td>NAD</td>
<td>Constructors should not be allowed to return normally after an exception</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#212">212</a></td>
@@ -1317,19 +1317,19 @@ accessible?</td>
<td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#213">213</a></td>
<td>TC1</td>
<td>Lookup in dependent base classes</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#214">214</a></td>
<td>CD1</td>
<td>Partial ordering of function templates is underspecified</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#215">215</a></td>
<td>CD1</td>
<td>Template parameters are not allowed in <I>nested-name-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#216">216</a></td>
More information about the cfe-commits
mailing list