[libc++] Improve diagnostics for non-const comparators and hashers in associative...
authorLouis Dionne <ldionne@apple.com>
Thu, 6 Dec 2018 21:46:17 +0000 (21:46 +0000)
committerLouis Dionne <ldionne@apple.com>
Thu, 6 Dec 2018 21:46:17 +0000 (21:46 +0000)
commit3560fbf3049045bf2ac3f3ecb1ddeb73cbe946cf
treee7c0b1ff885767ec43d44cf846c4ddb3650caa6c
parent037ed1befd3ae2677cb09af72214420e80344f0a
[libc++] Improve diagnostics for non-const comparators and hashers in associative containers

Summary:
When providing a non-const-callable comparator in a map or set, the
warning diagnostic does not include the point of instantiation of
the container that triggered the warning, which makes it difficult
to track down the problem. This commit improves the diagnostic by
placing it directly in the body of the associative container.

The same change is applied to unordered associative containers, which
had a similar problem.

Finally, this commit cleans up the forward declarations of several
map and unordered_map helpers, which are not needed anymore.

<rdar://problem/41370747>

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D48955

llvm-svn: 348529
libcxx/docs/UsingLibcxx.rst
libcxx/include/__hash_table
libcxx/include/__tree
libcxx/include/map
libcxx/include/set
libcxx/include/unordered_map
libcxx/include/unordered_set
libcxx/test/libcxx/containers/associative/non_const_comparator.fail.cpp
libcxx/test/libcxx/containers/unord/non_const_comparator.fail.cpp