diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-11-17 06:39:43 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-11-17 06:39:43 +0000 |
commit | 3cde3d245a86653bd2a7c9719d7edd2d74a4f66b (patch) | |
tree | e7f67940bd0ef75d737e9d7599d59d5599cec783 | |
parent | 4d078a3d6fb72d13becefa5bc163ba3cde15baee (diff) | |
download | bcm5719-llvm-3cde3d245a86653bd2a7c9719d7edd2d74a4f66b.tar.gz bcm5719-llvm-3cde3d245a86653bd2a7c9719d7edd2d74a4f66b.zip |
Tests for core issue 241-250.
llvm-svn: 194951
-rw-r--r-- | clang/test/CXX/drs/dr0xx.cpp | 2 | ||||
-rw-r--r-- | clang/test/CXX/drs/dr2xx.cpp | 123 | ||||
-rw-r--r-- | clang/www/cxx_dr_status.html | 20 | ||||
-rwxr-xr-x | clang/www/make_cxx_dr_status | 6 |
4 files changed, 139 insertions, 12 deletions
diff --git a/clang/test/CXX/drs/dr0xx.cpp b/clang/test/CXX/drs/dr0xx.cpp index 70a9e491942..265a52d9261 100644 --- a/clang/test/CXX/drs/dr0xx.cpp +++ b/clang/test/CXX/drs/dr0xx.cpp @@ -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; diff --git a/clang/test/CXX/drs/dr2xx.cpp b/clang/test/CXX/drs/dr2xx.cpp index 139b99f4da0..7c8d7bbbac3 100644 --- a/clang/test/CXX/drs/dr2xx.cpp +++ b/clang/test/CXX/drs/dr2xx.cpp @@ -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@-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<>; +} diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index 5fa95f4e9d1..04fc4a04c74 100644 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -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> diff --git a/clang/www/make_cxx_dr_status b/clang/www/make_cxx_dr_status index d2527deb8c7..4750e1b2cbb 100755 --- a/clang/www/make_cxx_dr_status +++ b/clang/www/make_cxx_dr_status @@ -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: |