[libcxx-commits] [PATCH] D60540: [libc++] Make sure we don't eagerly diagnose non-const comparators for containers of incomplete types

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 10 15:02:23 PDT 2019


ldionne created this revision.
ldionne added reviewers: EricWF, mclow.lists.
Herald added subscribers: libcxx-commits, dexonsmith, jkorous, christof.
Herald added a project: libc++.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60540

Files:
  libcxx/include/map
  libcxx/include/set
  libcxx/include/unordered_map
  libcxx/include/unordered_set
  libcxx/test/libcxx/containers/associative/non_const_comparator.pass.cpp
  libcxx/test/libcxx/containers/unord/non_const_comparator.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60540.194593.patch
Type: text/x-patch
Size: 10283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190410/4869e3f4/attachment-0001.bin>


More information about the libcxx-commits mailing list