-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[libcxx] improves diagnostics for containers with bad value types #106296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
5529499
1e6b81b
6c1e1e3
938299d
65346a3
472ffcf
7596a2e
25e999f
5a1b902
99a4509
45c85d6
dbf872a
e596964
e2d65c0
0487281
6d9ce9e
c49b7e8
eb2fd68
55a2e7a
d9043c4
ab41024
7bd03b3
ef9d9c3
f0f88d7
bb82c95
33a452d
6981a2a
9fe3f4a
b97942e
02ffa16
f75d1ae
20e0996
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,12 @@ | |
| #include <__memory/allocator_traits.h> | ||
| #include <__type_traits/is_const.h> | ||
| #include <__type_traits/is_constant_evaluated.h> | ||
| #include <__type_traits/is_function.h> | ||
| #include <__type_traits/is_reference.h> | ||
| #include <__type_traits/is_same.h> | ||
| #include <__type_traits/is_void.h> | ||
| #include <__type_traits/is_volatile.h> | ||
| #include <__type_traits/remove_reference.h> | ||
| #include <__utility/forward.h> | ||
| #include <cstddef> | ||
| #include <new> | ||
|
|
@@ -76,8 +79,16 @@ struct __non_trivial_if<true, _Unique> { | |
|
|
||
| template <class _Tp> | ||
| class _LIBCPP_TEMPLATE_VIS allocator : private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> > { | ||
| static_assert(!is_const<_Tp>::value, "std::allocator does not support const types"); | ||
| static_assert(!is_volatile<_Tp>::value, "std::allocator does not support volatile types"); | ||
| static_assert(!is_const<_Tp>::value, "'std::allocator' can only allocate non-const object types"); | ||
| static_assert(!is_volatile<_Tp>::value, "'std::allocator' can only allocate non-volatile object types"); | ||
| static_assert(!is_reference<_Tp>::value || !is_function<typename remove_reference<_Tp>::type>::value, | ||
| "'std::allocator' can only allocate object types; function references are not objects (consider using " | ||
| "a function pointer)"); | ||
| static_assert(!is_reference<_Tp>::value, | ||
| "'std::allocator' can only allocate object types; references are not objects"); | ||
|
||
| static_assert( | ||
| !is_function<_Tp>::value, | ||
| "'std::allocator' can only allocate object types; functions are not objects (consider using a function pointer)"); | ||
|
|
||
| public: | ||
| typedef size_t size_type; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.