PR libstdc++/48101 improve errors for invalid container specializations
commit7086d631bbca33f0f355ef571d0c4802be249ce8
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Nov 2017 20:47:09 +0000 (21 20:47 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Nov 2017 20:47:09 +0000 (21 20:47 +0000)
treea5b1601ca999eb5b5adc347e7dbc787e7e89b78f
parent0c45740b611e0930073eeae00422a17c62c2d983
PR libstdc++/48101 improve errors for invalid container specializations

PR libstdc++/48101
* include/bits/allocator.h (allocator<const _Tp>)
(allocator<volatile _Tp>, allocator<const volatile _Tp>): Add partial
specializations.
* include/bits/forward_list.h (forward_list): Add static assertions.
* include/bits/hashtable.h (__cache_default): Use
__is_nothrow_invocable instead of __is_noexcept_hash.
(_Hashtable): Add static assertions.
* include/bits/hashtable_policy.h (__is_noexcept_hash): Remove.
* include/bits/stl_deque.h (deque): Add static assertions.
* include/bits/stl_function.h (_Identity<const _Tp>): Add partial
specialization.
* include/bits/stl_list.h (list): Add static assertions.
* include/bits/stl_map.h (map): Likewise.
* include/bits/stl_multimap.h (multimap): Likewise.
* include/bits/stl_multiset.h (multiset): Likewise.
* include/bits/stl_set.h (set): Likewise.
* include/bits/stl_tree.h (_Rb_tree): Likewise.
* include/bits/stl_vector.h (vector): Likewise.
* include/bits/unordered_map.h (unordered_map, unordered_multimap):
Use typename instead of class in template-parameter-list and remove
spaces.
* include/bits/unordered_set.h (unordered_set, unordered_multiset):
Likewise.
* testsuite/23_containers/deque/48101-2_neg.cc: New test.
* testsuite/23_containers/deque/48101_neg.cc: New test.
* testsuite/23_containers/forward_list/48101-2_neg.cc: New test.
* testsuite/23_containers/forward_list/48101_neg.cc: New test.
* testsuite/23_containers/list/48101-2_neg.cc: New test.
* testsuite/23_containers/list/48101_neg.cc: New test.
* testsuite/23_containers/map/48101-2_neg.cc: New test.
* testsuite/23_containers/map/48101_neg.cc: New test.
* testsuite/23_containers/map/operations/31440.cc: Fix comparison
object to have const-qualified call operator.
* testsuite/23_containers/multimap/48101-2_neg.cc: New test.
* testsuite/23_containers/multimap/48101_neg.cc: New test.
* testsuite/23_containers/multiset/48101-2_neg.cc: New test.
* testsuite/23_containers/multiset/48101_neg.cc: New test.
* testsuite/23_containers/set/48101-2_neg.cc: New test.
* testsuite/23_containers/set/48101_neg.cc: New test.
* testsuite/23_containers/unordered_map/48101-2_neg.cc: New test.
* testsuite/23_containers/unordered_map/48101_neg.cc: New test.
* testsuite/23_containers/unordered_multimap/48101-2_neg.cc: New test.
* testsuite/23_containers/unordered_multimap/48101_neg.cc: New test.
* testsuite/23_containers/unordered_multiset/48101-2_neg.cc: New test.
* testsuite/23_containers/unordered_multiset/48101_neg.cc: New test.
* testsuite/23_containers/unordered_set/48101-2_neg.cc: New test.
* testsuite/23_containers/unordered_set/48101_neg.cc: New test.
* testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust
dg-error line number.
* testsuite/23_containers/vector/48101-2_neg.cc: New test.
* testsuite/23_containers/vector/48101_neg.cc: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255035 138bc75d-0d04-0410-961f-82ee72b054a4
42 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/allocator.h
libstdc++-v3/include/bits/forward_list.h
libstdc++-v3/include/bits/hashtable.h
libstdc++-v3/include/bits/hashtable_policy.h
libstdc++-v3/include/bits/stl_deque.h
libstdc++-v3/include/bits/stl_function.h
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/include/bits/stl_vector.h
libstdc++-v3/include/bits/unordered_map.h
libstdc++-v3/include/bits/unordered_set.h
libstdc++-v3/testsuite/23_containers/deque/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/deque/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 60% similarity]
libstdc++-v3/testsuite/23_containers/forward_list/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/forward_list/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 60% similarity]
libstdc++-v3/testsuite/23_containers/list/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/list/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 60% similarity]
libstdc++-v3/testsuite/23_containers/map/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 62% similarity]
libstdc++-v3/testsuite/23_containers/map/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 62% similarity]
libstdc++-v3/testsuite/23_containers/map/operations/31440.cc
libstdc++-v3/testsuite/23_containers/multimap/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 62% similarity]
libstdc++-v3/testsuite/23_containers/multimap/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 62% similarity]
libstdc++-v3/testsuite/23_containers/multiset/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/multiset/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 60% similarity]
libstdc++-v3/testsuite/23_containers/set/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/set/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 60% similarity]
libstdc++-v3/testsuite/23_containers/unordered_map/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/unordered_map/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 60% similarity]
libstdc++-v3/testsuite/23_containers/unordered_multimap/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/unordered_multimap/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 60% similarity]
libstdc++-v3/testsuite/23_containers/unordered_multiset/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/unordered_multiset/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/unordered_set/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/unordered_set/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc
libstdc++-v3/testsuite/23_containers/vector/48101-2_neg.cc [copied from libstdc++-v3/testsuite/23_containers/map/operations/31440.cc with 61% similarity]
libstdc++-v3/testsuite/23_containers/vector/48101_neg.cc [copied from libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc with 60% similarity]