Skip to content

Commit 2ff98ea

Browse files
error: call to deleted constructor of '__node_value_type' (aka 'std::__value_type<int, int>')
1 parent 7930edd commit 2ff98ea

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

libcxx/test/std/containers/associative/map/map.ops/contains.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ TEST_CONSTEXPR_CXX26 bool test() {
4949
test<std::map<int, E>, std::pair<int, E> >(
5050
-1, std::make_pair(1, E{}), std::make_pair(2, E{}), std::make_pair(3, E{}), std::make_pair(4, E{}));
5151
}
52-
// FIXME: remove if when multimap is made constexpr
52+
// FIXME: remove when multimap is made constexpr
5353
if(!TEST_IS_CONSTANT_EVALUATED)
5454
{
5555
test<std::multimap<char, int>, std::pair<char, int> >(

libcxx/test/std/containers/associative/map/map.ops/contains_transparent.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TEST_CONSTEXPR_CXX26 bool test() {
4040
TEST_CONSTEXPR_CXX26 bool test() {
4141
test<std::map<std::pair<int, int>, int, Comp> >();
4242

43-
// FIXME: remove if when multimap is made constexpr
43+
// FIXME: remove when multimap is made constexpr
4444
if(!TEST_IS_CONSTANT_EVALUATED)
4545
{
4646
test<std::multimap<std::pair<int, int>, int, Comp> >();

libcxx/test/std/containers/container.node/node_handle.pass.cpp

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
#include "test_macros.h"
1616
#include "min_allocator.h"
1717

18-
// TODO: add constexpr to this test as well
19-
2018
// [container.node.overview] Table 83.
2119
template <class K, class T, class C1, class C2, class H1, class H2, class E1, class E2, class A_set, class A_map>
2220
struct node_compatibility_table {
@@ -109,7 +107,7 @@ static_assert(
109107
"");
110108

111109
template <class Container>
112-
void test_node_handle_operations() {
110+
TEST_CONSTEXPR_CXX26 bool test_node_handle_operations() {
113111
Container c;
114112

115113
typename Container::node_type nt1, nt2 = c.extract(c.emplace().first);
@@ -119,10 +117,12 @@ void test_node_handle_operations() {
119117
std::swap(nt1, nt2);
120118
assert(nt1.get_allocator() == c.get_allocator());
121119
assert(nt2.empty());
120+
121+
return true;
122122
}
123123

124124
template <class Container>
125-
void test_node_handle_operations_multi() {
125+
TEST_CONSTEXPR_CXX26 bool test_node_handle_operations_multi() {
126126
Container c;
127127

128128
typename Container::node_type nt1, nt2 = c.extract(c.emplace());
@@ -132,30 +132,51 @@ void test_node_handle_operations_multi() {
132132
std::swap(nt1, nt2);
133133
assert(nt1.get_allocator() == c.get_allocator());
134134
assert(nt2.empty());
135+
136+
return true;
135137
}
136138

137139
template <class>
138-
void test_typedef() {}
140+
TEST_CONSTEXPR_CXX26 bool test_typedef() { return true; }
139141

140142
template <class Container>
141-
void test_insert_return_type() {
143+
TEST_CONSTEXPR_CXX26 bool test_insert_return_type() {
142144
test_typedef<typename Container::insert_return_type>();
145+
return true;
143146
}
144147

145-
int main(int, char**) {
148+
TEST_CONSTEXPR_CXX26 bool test() {
149+
146150
test_node_handle_operations<std::map<int, int>>();
151+
152+
// FIXME: update when other containers are made constexpr
153+
if (!TEST_IS_CONSTANT_EVALUATED)
154+
{
147155
test_node_handle_operations_multi<std::multimap<int, int>>();
148156
test_node_handle_operations<std::set<int>>();
149157
test_node_handle_operations_multi<std::multiset<int>>();
150158
test_node_handle_operations<std::unordered_map<int, int>>();
151159
test_node_handle_operations_multi<std::unordered_multimap<int, int>>();
152160
test_node_handle_operations<std::unordered_set<int>>();
153161
test_node_handle_operations_multi<std::unordered_multiset<int>>();
162+
}
154163

155164
test_insert_return_type<std::map<int, int>>();
165+
166+
// FIXME: update when other containers are made constexpr
167+
if (!TEST_IS_CONSTANT_EVALUATED)
168+
{
156169
test_insert_return_type<std::set<int>>();
157170
test_insert_return_type<std::unordered_map<int, int>>();
158171
test_insert_return_type<std::unordered_set<int>>();
172+
}
173+
return true;
174+
}
159175

176+
int main(int, char**) {
177+
assert(test());
178+
#if TEST_STD_VER >= 26
179+
static_assert(test());
180+
#endif
160181
return 0;
161182
}

0 commit comments

Comments
 (0)