Skip to content

Commit

Permalink
replaces TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdb committed Sep 7, 2024
1 parent f0f88d7 commit bb82c95
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 1,519 deletions.
1,459 changes: 0 additions & 1,459 deletions diags.patch

This file was deleted.

4 changes: 0 additions & 4 deletions libcxx/include/map
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,6 @@ public:

template <class _Key, class _Tp, class _Compare = less<_Key>, class _Allocator = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TEMPLATE_VIS map {
// TODO(#106635): replace with _LIBCPP_CHECK_CONTAINER_VALUE_TYPE_REQUIREMENTS
// Remember to remove relevant headers when this is completed.
static_assert(!is_lvalue_reference<_Key>::value, "'std::map' cannot hold references");
static_assert(!is_function<_Key>::value && !is_function<_Tp>::value, "'std::map' cannot hold functions");
static_assert(!is_void<_Key>::value && !is_void<_Tp>::value, "'std::map' cannot hold 'void'");
Expand Down Expand Up @@ -1651,8 +1649,6 @@ erase_if(map<_Key, _Tp, _Compare, _Allocator>& __c, _Predicate __pred) {

template <class _Key, class _Tp, class _Compare = less<_Key>, class _Allocator = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TEMPLATE_VIS multimap {
// TODO(#106635): replace with _LIBCPP_CHECK_CONTAINER_VALUE_TYPE_REQUIREMENTS
// Remember to remove relevant headers when this is completed.
static_assert(!is_lvalue_reference<_Key>::value, "'std::multimap' cannot hold references");
static_assert(!is_function<_Key>::value && !is_function<_Tp>::value, "'std::multimap' cannot hold functions");
static_assert(!is_void<_Key>::value && !is_void<_Tp>::value, "'std::multimap' cannot hold 'void'");
Expand Down
4 changes: 0 additions & 4 deletions libcxx/include/unordered_map
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,6 @@ template <class _Key,
class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TEMPLATE_VIS unordered_map {
// TODO(#106635): replace with _LIBCPP_CHECK_CONTAINER_VALUE_TYPE_REQUIREMENTS
// Remember to remove relevant headers when this is completed.
static_assert(!is_reference<_Key>::value, "'std::unordered_map' cannot hold references");
static_assert(!is_function<_Key>::value && !is_function<_Tp>::value, "'std::unordered_map' cannot hold functions");
static_assert(!is_void<_Key>::value && !is_void<_Tp>::value, "'std::unordered_map' cannot hold 'void'");
Expand Down Expand Up @@ -1843,8 +1841,6 @@ template <class _Key,
class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TEMPLATE_VIS unordered_multimap {
// TODO(#106635): replace with _LIBCPP_CHECK_CONTAINER_VALUE_TYPE_REQUIREMENTS
// Remember to remove relevant headers when this is completed.
static_assert(!is_reference<_Key>::value, "'std::unordered_multimap' cannot hold references");
static_assert(!is_function<_Key>::value && !is_function<_Tp>::value,
"'std::unordered_multimap' cannot hold functions");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@

#include <map>

std::map<int const, int> K1;
std::map<int, int const> M1;
// TODO(#106635): turn this into a compile-time error
std::map<int const, int> K1; // not an error
std::map<int, int const> M1; // not an error

std::map<int volatile, int> K2;
std::map<int, int volatile> M2;
// TODO(#106635): turn this into a compile-time error
std::map<int volatile, int> K2; // not an error
std::map<int, int volatile> M2; // not an error

std::map<int&, int> K3;
std::map<int, int&> M3; // TODO(#106635): turn this into a compile-time error
// expected-error@*:* 1 {{'std::map' cannot hold references}}
// expected-error@*:* {{'std::map' cannot hold references}}
std::map<int, int&> M3; // not an error

std::map<int&&, int> K4;
std::map<int, int&&> M4;
// TODO(#106635): turn this into a compile-time error
std::map<int&&, int> K4; // not an error
std::map<int, int&&> M4; // not an error

std::map<int(), int> K5;
std::map<int(int), int> K6;
Expand All @@ -39,9 +36,8 @@ std::map<int, void> M8;
// expected-error@*:* 2 {{'std::map' cannot hold 'void'}}

std::map<int[], int> K9;
std::map<int, int[]> M9; // TODO(#106635): turn this into a compile-time error
// expected-error@*:*{{'std::map' cannot hold C arrays of an unknown size}}
std::map<int, int[]> M9; // not an error

std::map<int[2], int> K10;
std::map<int, int[2]> M10;
// TODO(#106635): turn this into a compile-time error
std::map<int[2], int> K10; // not an error
std::map<int, int[2]> M10; // not an error
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@

#include <map>

std::multimap<int const, int> K1;
std::multimap<int, int const> M1;
// TODO(#106635): turn this into a compile-time error
std::multimap<int const, int> K1; // not an error
std::multimap<int, int const> M1; // not an error

std::multimap<int volatile, int> K2;
std::multimap<int, int volatile> M2;
// TODO(#106635): turn this into a compile-time error
std::multimap<int volatile, int> K2; // not an error
std::multimap<int, int volatile> M2; // not an error

std::multimap<int&, int> K3;
std::multimap<int, int&> M3; // TODO(#106635): turn this into a compile-time error
// expected-error@*:* 1 {{'std::multimap' cannot hold references}}
// expected-error@*:* {{'std::multimap' cannot hold references}}
std::multimap<int, int&> M3; // not an error

std::multimap<int&&, int> K4;
std::multimap<int, int&&> M4;
// TODO(#106635): turn this into a compile-time error
std::multimap<int&&, int> K4; // not an error
std::multimap<int, int&&> M4; // not an error

std::multimap<int(), int> K5;
std::multimap<int(int), int> K6;
Expand All @@ -39,9 +36,8 @@ std::multimap<int, void> M8;
// expected-error@*:* 2 {{'std::multimap' cannot hold 'void'}}

std::multimap<int[], int> K9;
std::multimap<int, int[]> M9; // TODO(#106635): turn this into a compile-time error
// expected-error@*:*{{'std::multimap' cannot hold C arrays of an unknown size}}
std::multimap<int, int[]> M9; // not an error

std::multimap<int[2], int> K10;
std::multimap<int, int[2]> M10;
// TODO(#106635): turn this into a compile-time error
std::multimap<int[2], int> K10; // not an error
std::multimap<int, int[2]> M10; // not an error
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,19 @@ struct hash<S volatile> {
};
} // namespace std

std::unordered_map<S const, int> K1;
std::unordered_map<int, int const> M1;
// TODO(#106635): turn this into a compile-time error
std::unordered_map<S const, int> K1; // not an error
std::unordered_map<int, int const> M1; // not an error

std::unordered_map<S volatile, int> K2;
std::unordered_map<int, int volatile> M2;
// TODO(#106635): turn this into a compile-time error
std::unordered_map<S volatile, int> K2; // not an error
std::unordered_map<int, int volatile> M2; // not an error

std::unordered_map<int&, int> K3;
std::unordered_map<int, int&> M3; // TODO(#106635): turn this into a compile-time error
// expected-error@*:* 1 {{'std::unordered_map' cannot hold references}}
// expected-error@*:* {{'std::unordered_map' cannot hold references}}
std::unordered_map<int, int&> M3; // not an error

std::unordered_map<int&&, int> K4;
std::unordered_map<int, int&&> M4; // TODO(#106635): turn this into a compile-time error
// expected-error@*:*{{'std::unordered_map' cannot hold references}}
std::unordered_map<int, int&&> M4; // not an error

std::unordered_map<int(), int> K5;
std::unordered_map<int(int), int> K6;
Expand All @@ -67,9 +65,9 @@ std::unordered_map<int, void> M8;
// expected-error@*:* 2 {{'std::unordered_map' cannot hold 'void'}}

std::unordered_map<int[], int> K9;
std::unordered_map<int, int[]> M9; // TODO(#106635): turn this into a compile-time error
// expected-error@*:*{{'std::unordered_map' cannot hold C arrays of an unknown size}}
std::unordered_map<int, int[]> M9; // not an error

std::unordered_map<int[2], int> K10;
std::unordered_map<int, int[2]> M10; // TODO(#106635): turn this into a compile-time error
// expected-error@*:*{{'std::unordered_map' cannot hold C arrays before C++20}}
std::unordered_map<int, int[2]> M10; // not an error
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,19 @@ struct hash<S volatile> {
};
} // namespace std

std::unordered_multimap<S const, int> K1;
std::unordered_multimap<int, int const> M1;
// TODO(#106635): turn this into a compile-time error
std::unordered_multimap<S const, int> K1; // not an error
std::unordered_multimap<int, int const> M1; // not an error

std::unordered_multimap<S volatile, int> K2;
std::unordered_multimap<int, int volatile> M2;
// TODO(#106635): turn this into a compile-time error
std::unordered_multimap<S volatile, int> K2; // not an error
std::unordered_multimap<int, int volatile> M2; // not an error

std::unordered_multimap<int&, int> K3;
std::unordered_multimap<int, int&> M3; // TODO(#106635): turn this into a compile-time error
// expected-error@*:* 1 {{'std::unordered_multimap' cannot hold references}}
// expected-error@*:*{{'std::unordered_multimap' cannot hold references}}
std::unordered_multimap<int, int&> M3; // not an error

std::unordered_multimap<int&&, int> K4;
std::unordered_multimap<int, int&&> M4; // TODO(#106635): turn this into a compile-time error
// expected-error@*:*{{'std::unordered_multimap' cannot hold references}}
std::unordered_multimap<int, int&&> M4; // not an error

std::unordered_multimap<int(), int> K5;
std::unordered_multimap<int(int), int> K6;
Expand All @@ -62,9 +60,9 @@ std::unordered_multimap<int, void> M8;
// expected-error@*:* 2 {{'std::unordered_multimap' cannot hold 'void'}}

std::unordered_multimap<int[], int> K9;
std::unordered_multimap<int, int[]> M9; // TODO(#106635): turn this into a compile-time error
// expected-error@*:*{{'std::unordered_multimap' cannot hold C arrays of an unknown size}}
std::unordered_multimap<int, int[]> M9; // not an error

std::unordered_multimap<int[2], int> K10;
std::unordered_multimap<int, int[2]> M10; // TODO(#106635): turn this into a compile-time error
// expected-error@*:*{{'std::unordered_multimap' cannot hold C arrays before C++20}}
std::unordered_multimap<int, int[2]> M10; // not an error

0 comments on commit bb82c95

Please sign in to comment.