summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-08-09 16:53:45 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-08-09 16:53:45 +0000
commit6afbc442d6201f32fda56a85f2c13f82a5132596 (patch)
tree655962ab628c2269c56a60f1c153077ab47d29c5
parent735d0dcccff0eb1e3ba8f353495a25640e836e0c (diff)
downloadbcm5719-llvm-6afbc442d6201f32fda56a85f2c13f82a5132596.tar.gz
bcm5719-llvm-6afbc442d6201f32fda56a85f2c13f82a5132596.zip
Add a check for arrays of unknown bounds to is_destructible. This fixes http://llvm.org/bugs/show_bug.cgi?id=16839
llvm-svn: 188080
-rw-r--r--libcxx/include/type_traits4
-rw-r--r--libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 99e34d13323..b5eb40d2a59 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -1461,6 +1461,10 @@ template <class _Tp>
struct is_destructible
: public __destructible_imp<_Tp> {};
+template <class _Tp>
+struct is_destructible<_Tp[]>
+ : public false_type {};
+
// move
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
index cc7f75eb193..b4432dff7cd 100644
--- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
+++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
@@ -69,7 +69,9 @@ int main()
test_is_destructible<const int*>();
test_is_destructible<char[3]>();
test_is_destructible<bit_zero>();
+ test_is_destructible<int[3]>();
+ test_is_not_destructible<int[]>();
test_is_not_destructible<void>();
test_is_not_destructible<Abstract>();
#if __has_feature(cxx_access_control_sfinae)
OpenPOWER on IntegriCloud