diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -482,14 +482,6 @@ typedef typename allocator_traits<__begin_node_allocator>::pointer __begin_node_pointer; - static_assert((!is_same::value), - "internal allocator type must differ from user-specified " - "type; otherwise overload resolution breaks"); - - static_assert(is_same >::value, - "[allocator.requirements] states that rebinding an allocator to the same type should result in the " - "original allocator"); - __compressed_pair<__begin_node, __node_allocator> __before_begin_; _LIBCPP_INLINE_VISIBILITY @@ -659,9 +651,17 @@ typedef _Tp value_type; typedef _Alloc allocator_type; - static_assert((is_same::value), + static_assert(is_same::value, "Allocator::value_type must be same type as value_type"); + static_assert(is_same, value_type> >::value, + "[allocator.requirements] states that rebinding an allocator to the same type should result in the " + "original allocator"); + + static_assert((!is_same::value), + "internal allocator type must differ from user-specified " + "type; otherwise overload resolution breaks"); + typedef value_type& reference; typedef const value_type& const_reference; typedef typename allocator_traits::pointer pointer; diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -828,7 +828,7 @@ typedef _Tp value_type; typedef _Alloc allocator_type; static_assert((is_same::value), - "Invalid allocator::value_type"); + "Allocator::value_type must be same type as value_type"); typedef value_type& reference; typedef const value_type& const_reference; typedef typename base::pointer pointer; diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1035,7 +1035,7 @@ typedef value_type& reference; typedef const value_type& const_reference; static_assert((is_same::value), - "Invalid allocator::value_type"); + "Allocator::value_type must be same type as value_type"); private: typedef __hash_value_type __value_type; @@ -1928,7 +1928,7 @@ typedef value_type& reference; typedef const value_type& const_reference; static_assert((is_same::value), - "Invalid allocator::value_type"); + "Allocator::value_type must be same type as value_type"); private: typedef __hash_value_type __value_type; diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -513,7 +513,7 @@ typedef value_type& reference; typedef const value_type& const_reference; static_assert((is_same::value), - "Invalid allocator::value_type"); + "Allocator::value_type must be same type as value_type"); static_assert(is_same, value_type> >::value, "[allocator.requirements] states that rebinding an allocator to the same type should result in the " @@ -1173,7 +1173,7 @@ typedef value_type& reference; typedef const value_type& const_reference; static_assert((is_same::value), - "Invalid allocator::value_type"); + "Allocator::value_type must be same type as value_type"); private: typedef __hash_table __table; diff --git a/libcxx/test/std/containers/associative/map/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/associative/map/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/associative/map/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/associative/map/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/associative/map/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/associative/map/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::map, std::allocator > m; - - return 0; -} +std::map, std::allocator > m; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/associative/multimap/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/associative/multimap/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/associative/multimap/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/associative/multimap/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::multimap, std::allocator > m; - - return 0; -} +std::multimap, std::allocator > m; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/associative/multiset/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/associative/multiset/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/associative/set/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/associative/multiset/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::set, std::allocator > s; - - return 0; -} +std::multiset, std::allocator > m; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/associative/multiset/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/associative/set/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/associative/multiset/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/associative/set/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/associative/multiset/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/associative/set/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::multiset, std::allocator > ms; - - return 0; -} +std::set, std::allocator > m; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp --- a/libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp +++ b/libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp @@ -32,7 +32,7 @@ static_assert(std::ranges::bidirectional_range); static_assert(!std::ranges::random_access_range); static_assert(std::ranges::common_range); -static_assert(std::ranges::input_range); +static_assert(std::ranges::input_range); static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); diff --git a/libcxx/test/std/containers/sequences/deque/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/sequences/deque/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/sequences/deque/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/sequences/deque/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/sequences/deque/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/sequences/deque/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::deque > d; - - return 0; -} +std::deque > d; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/sequences/forwardlist/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::forward_list > fl; - - return 0; -} +std::forward_list > fl; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/sequences/list/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/sequences/list/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/sequences/list/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/sequences/list/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/sequences/list/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/sequences/list/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::list > l; - - return 0; -} +std::list > l; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/sequences/vector/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/sequences/vector/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/sequences/vector/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/sequences/vector/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/sequences/vector/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/sequences/vector/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::vector > v; - - return 0; -} +std::vector > v; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/unord/unord.map/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/unord/unord.map/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/unord/unord.map/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::unordered_map, std::less, std::allocator > m; - - return 0; -} +std::unordered_map, std::less, std::allocator > m; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/unord/unord.multimap/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::unordered_multimap, std::less, std::allocator > m; - - return 0; -} +std::unordered_multimap, std::less, std::allocator > m; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/unord/unord.set/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::unordered_set, std::less, std::allocator > v; - - return 0; -} +std::unordered_multiset, std::less, std::allocator > v; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}} diff --git a/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp b/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.verify.cpp rename from libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp rename to libcxx/test/std/containers/unord/unord.set/allocator_mismatch.verify.cpp --- a/libcxx/test/std/containers/unord/unord.multiset/allocator_mismatch.compile.fail.cpp +++ b/libcxx/test/std/containers/unord/unord.set/allocator_mismatch.verify.cpp @@ -11,9 +11,5 @@ #include -int main(int, char**) -{ - std::unordered_multiset, std::less, std::allocator > v; - - return 0; -} +std::unordered_set, std::less, std::allocator > v; + // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}Allocator::value_type must be same type as value_type}}