llvm-project/libcxx
Louis Dionne 7c142fcc06 [libc++] Make sure we don't eagerly diagnose non-const comparators for containers of incomplete types
Summary:
In r348529, I improved the library-defined diagnostic for using containers
with a non-const comparator/hasher. However, the check is now performed
too early, which leads to the diagnostic being emitted in cases where it
shouldn't. See PR41360 for details.

This patch moves the diagnostic to the destructor of the containers, which
means that the diagnostic will only be emitted when the container is instantiated
at a point where the comparator and the key/value are required to be complete.
We still retain better diagnostics than before r348529, because the diagnostics
are performed in the containers themselves instead of __tree and __hash_table.

As a drive-by fix, I improved the diagnostic to mention that we can't find
a _viable_ const call operator, as suggested by EricWF in PR41360.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits, zoecarver

Tags: #libc

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

llvm-svn: 358189
2019-04-11 16:14:56 +00:00
..
benchmarks Add more benchmarks for literal strings. 2019-04-03 17:40:51 +00:00
cmake [CMake] Differentiate between static and shared libc++abi 2019-04-03 01:33:14 +00:00
docs Remove repeated words from BuildingLibcxx.rst 2019-04-10 23:44:27 +00:00
fuzzing Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
include [libc++] Make sure we don't eagerly diagnose non-const comparators for containers of incomplete types 2019-04-11 16:14:56 +00:00
lib [CMake] Fix statically linking in libcxxabi if built separately 2019-04-09 14:31:09 +00:00
src Fix typo that I introduced in r357413. Thanks to ensadc@mailnesia.com for the catch. 2019-04-02 14:00:36 +00:00
test [libc++] Make sure we don't eagerly diagnose non-const comparators for containers of incomplete types 2019-04-11 16:14:56 +00:00
utils Handle TLS values in sym_check 2019-04-04 15:37:10 +00:00
www [libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807 2019-04-03 17:54:37 +00:00
.arcconfig [libcxx] Set up .arcconfig to point to new Diffusion CXX repository 2017-12-04 17:55:28 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore Implement N4606 optional 2016-10-12 07:46:20 +00:00
CMakeLists.txt [libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms 2019-03-25 14:56:29 +00:00
CREDITS.TXT Try again, this time with the correct address 2017-12-29 19:26:53 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
NOTES.TXT Reland "Use custom command and target to install libc++ headers" 2018-06-12 03:10:02 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00
appveyor-reqs-install.cmd Attempt to upgrade compiler used by appveyor builds 2019-04-03 20:40:01 +00:00
appveyor.yml disable appveyor config for MSVC 2015 2019-04-03 20:36:51 +00:00