[libcxx] r189687 - is_destructible for function types was mistakenly returning true instead of false. This is true in both C++11 and C++1y, but has been clarified by the post C++11 LWG issue 2049.

Howard Hinnant hhinnant at apple.com
Fri Aug 30 12:12:42 PDT 2013


Author: hhinnant
Date: Fri Aug 30 14:12:42 2013
New Revision: 189687

URL: http://llvm.org/viewvc/llvm-project?rev=189687&view=rev
Log:
is_destructible for function types was mistakenly returning true instead of false.  This is true in both C++11 and C++1y, but has been clarified by the post C++11 LWG issue 2049.

Modified:
    libcxx/trunk/include/type_traits
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
    libcxx/trunk/www/cxx1y_status.html

Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=189687&r1=189686&r2=189687&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Fri Aug 30 14:12:42 2013
@@ -1446,7 +1446,8 @@ __is_destructible_test(_Tp&);
 false_type
 __is_destructible_test(__any);
 
-template <class _Tp, bool = is_void<_Tp>::value || is_abstract<_Tp>::value>
+template <class _Tp, bool = is_void<_Tp>::value || is_abstract<_Tp>::value
+                                                || is_function<_Tp>::value>
 struct __destructible_imp
     : public common_type
         <

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp?rev=189687&r1=189686&r2=189687&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp Fri Aug 30 14:12:42 2013
@@ -57,6 +57,8 @@ struct A
     ~A();
 };
 
+typedef void (Function) ();
+
 int main()
 {
     test_is_destructible<A>();
@@ -77,4 +79,5 @@ int main()
 #if __has_feature(cxx_access_control_sfinae) 
     test_is_not_destructible<NotEmpty>();
 #endif
+    test_is_not_destructible<Function>();
 }

Modified: libcxx/trunk/www/cxx1y_status.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx1y_status.html?rev=189687&r1=189686&r2=189687&view=diff
==============================================================================
--- libcxx/trunk/www/cxx1y_status.html (original)
+++ libcxx/trunk/www/cxx1y_status.html Fri Aug 30 14:12:42 2013
@@ -133,7 +133,7 @@
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2005">2005</a></td><td>unordered_map::insert(T&&) protection should apply to map too</td><td>Portland</td><td></td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2011">2011</a></td><td>Unexpected output required of strings</td><td>Portland</td><td>Complete</td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2048">2048</a></td><td>Unnecessary mem_fn overloads</td><td>Portland</td><td></td></tr>
-	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2049">2049</a></td><td>is_destructible is underspecified</td><td>Portland</td><td></td></tr>
+	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2049">2049</a></td><td>is_destructible is underspecified</td><td>Portland</td><td>Complete</td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2056">2056</a></td><td>future_errc enums start with value 0 (invalid value for broken_promise)</td><td>Portland</td><td></td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2058">2058</a></td><td>valarray and begin/end</td><td>Portland</td><td>Complete</td></tr>
   <tr><td></td><td></td><td></td><td></td></tr>





More information about the cfe-commits mailing list