<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Okay. I was just trying to give a heads up to Gauthier but I didn't act on it since it was late at night. I'll revert the change to <map>, but please be careful when you start working on the patch again as I'll revert additional commits that added XFAILs to the tests (specifically 782fff1). When you re-submit a patch, please make sure you include the XFAIL we had added.<div class=""><br class=""></div><div class="">Reverted here:</div><div class="">commit 1fab01f92bdb23bfce98ee1281fe7be10ec04373</div><div class=""><div class="">Author: Louis Dionne <<a href="mailto:ldionne@apple.com" class="">ldionne@apple.com</a>></div><div class="">Date:   Tue Jun 18 14:40:15 2019 +0000</div><div class=""><br class=""></div><div class="">    [libc++] Revert the addition of map/multimap CTAD</div><div class=""><br class=""></div><div class="">    This was found to be broken on Clang trunk. This is a revert of the</div><div class="">    following commits (the subsequent commits added XFAILs to the tests</div><div class="">    that were missing from the original submission):</div><div class=""><br class=""></div><div class="">        r362986: Implement deduction guides for map/multimap.</div><div class="">        r363014: Add some XFAILs</div><div class="">        r363097: Add more XFAILs</div><div class="">        r363197: Add even more XFAILs</div><div class=""><br class=""></div><div class="">    llvm-svn: 363688</div><div class=""><div class=""><div class=""><br class=""></div><div class="">Louis</div><div class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 17, 2019, at 22:43, Arthur O'Dwyer <<a href="mailto:arthur.j.odwyer@gmail.com" class="">arthur.j.odwyer@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class="">Louis, in that case, I suggest you just revert the change to <map>.  That is, I see two possibilities here —</div><div class=""><br class=""></div><div class="">(1) Gauthier's change to the core compiler is broken in a subtle way that just happened to break our recent change to <map>, or</div><div class="">(2) Arthur (me)'s change to <map> is broken in a subtle way that just happened to exploit the core compiler bug that Gauthier was fixing (which, incidentally, was reported by me)</div><div class=""><br class=""></div><div class="">— and I think (2) is vastly more likely than (1).</div><div class=""><br class=""></div><div class="">Unfortunately, we might need Richard Smith or Mike Spertus to explain exactly what's wrong with my change to <map>. :(</div><div class=""><br class=""></div><div class="">–Arthur</div><div class=""><br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 17, 2019 at 10:37 PM Louis Dionne <<a href="mailto:ldionne@apple.com" class="">ldionne@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class="">+ Gauthier</div><div class=""><br class=""></div>This is the culprit:<div class=""><br class=""></div><div class=""><div class="">commit a27d26e290545ff0686c0d08975baa53b9a4878b</div><div class="">Author: Gauthier Harnisch <<a href="mailto:tyker1@outlook.com" target="_blank" class="">tyker1@outlook.com</a>></div><div class="">Date:   Fri Jun 14 08:40:04 2019 +0000</div><div class=""><br class=""></div><div class="">    [clang] Fixing incorrect implicit deduction guides (PR41549)</div><div class=""><br class=""></div><div class="">    Summary:</div><div class="">    [[ <a href="https://bugs.llvm.org/show_bug.cgi?id=41549" target="_blank" class="">https://bugs.llvm.org/show_bug.cgi?id=41549</a> | bug report ]]</div><div class=""><br class=""></div><div class="">    Before this patch, implicit deduction guides were generated from the first declaration found by lookup.</div><div class="">    With this patch implicit deduction guides are generated from the definition of the class template.</div><div class="">    Also added test that was previously failing.</div><div class=""><br class=""></div><div class="">    Reviewers: rsmith</div><div class=""><br class=""></div><div class="">    Reviewed By: rsmith</div><div class=""><br class=""></div><div class="">    Subscribers: cfe-commits, Quuxplusone</div><div class=""><br class=""></div><div class="">    Tags: #clang</div><div class=""><br class=""></div><div class="">    Differential Revision: <a href="https://reviews.llvm.org/D63072" target="_blank" class="">https://reviews.llvm.org/D63072</a></div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jun 17, 2019, at 17:20, Michał Górny <<a href="mailto:mgorny@gentoo.org" target="_blank" class="">mgorny@gentoo.org</a>> wrote:</div><br class="gmail-m_-4213072650819352593Apple-interchange-newline"><div class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline" class="">On Mon, 2019-06-17 at 17:02 -0400, Louis Dionne wrote:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><blockquote type="cite" class="">On Jun 17, 2019, at 15:46, Louis Dionne via libcxx-commits <<a href="mailto:libcxx-commits@lists.llvm.org" target="_blank" class="">libcxx-commits@lists.llvm.org</a>> wrote:<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Jun 17, 2019, at 14:50, Michał Górny <<a href="mailto:mgorny@gentoo.org" target="_blank" class="">mgorny@gentoo.org</a>> wrote:<br class=""><br class="">On Mon, 2019-06-17 at 13:49 -0400, Arthur O'Dwyer wrote:<br class=""><blockquote type="cite" class="">On Mon, Jun 17, 2019 at 12:30 PM Michał Górny via Phabricator <<br class=""><a href="mailto:reviews@reviews.llvm.org" target="_blank" class="">reviews@reviews.llvm.org</a>> wrote:<br class=""><br class=""><blockquote type="cite" class="">mgorny added a comment.<br class=""><br class="">Marshall, `std/containers/associative/map/map.cons/deduct_const.pass.cpp`<br class="">test seems to be reliably failing from commit one on both Gentoo Linux and<br class="">NetBSD. Could you please look at the classical example of totally cryptic<br class="">C++ error? ;-)<br class=""><br class=""><br class=""><a href="http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20/steps/run%20unit%20tests/logs/FAIL%3A%20libc%2B%2B%3A%3Adeduct_const.pass.cpp" target="_blank" class="">http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20/steps/run%20unit%20tests/logs/FAIL%3A%20libc%2B%2B%3A%3Adeduct_const.pass.cpp</a><br class=""><br class=""></blockquote><br class="">Well, I can contribute that that's the error that you get when CTAD deduces<br class="">the wrong thing. Here it's looking at lines 98–100 of deduct_const.pass.cpp<br class=""><br class=""> std::map m({ PC{1,1L}, PC{2,2L}, PC{1,1L}, PC{INT_MAX,1L}, PC{3,1L} },<br class="">test_allocator<PC>(0, 45));<br class=""> ASSERT_SAME_TYPE(decltype(m), std::map<int, long, std::less<int>,<br class="">test_allocator<PC>>);<br class=""><br class="">and deducing the correct value_type for `m`, but it's incorrectly thinking<br class="">that `test_allocator<PC>` should be used as the *comparator* type, not<br class="">the *allocator<br class="">*type.  This is surprising/incorrect, because if all is going as expected,<br class="">then CTAD should be considering the deduction guides<br class=""><br class="">template<class _Key, class _Tp, class _Compare = less<typename<br class="">remove_const<_Key>::type>,<br class="">      class _Allocator = allocator<pair<const _Key, _Tp>>,<br class="">      class = typename enable_if<!__is_allocator<_Compare>::value,<br class="">void>::type,<br class="">      class = typename enable_if<__is_allocator<_Allocator>::value,<br class="">void>::type><br class="">map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator =<br class="">_Allocator())<br class="">-> map<typename remove_const<_Key>::type, _Tp, _Compare, _Allocator>;<br class=""><br class="">template<class _Key, class _Tp, class _Allocator,<br class="">      class = typename enable_if<__is_allocator<_Allocator>::value,<br class="">void>::type><br class="">map(initializer_list<pair<_Key, _Tp>>, _Allocator)<br class="">-> map<typename remove_const<_Key>::type, _Tp, less<typename<br class="">remove_const<_Key>::type>, _Allocator>;<br class=""><br class="">CTAD should see that the first guide fails substitution because<br class="">__is_allocator<test_allocator<PC>>::value (that is, test_allocator should<br class="">not be taken as the comparator type).<br class="">CTAD should see that the second guide does not fail substitution, so CTAD<br class="">should unambiguously use the second guide.<br class=""><br class="">The test passes on OSX using clang trunk.  I don't see any #ifdefs or<br class="">anything in include/ or in test/support/test_allocator.h that would cause<br class="">different behavior on Linux or NetBSD.  If you try clang trunk on Linux or<br class="">NetBSD, do you see different behavior (versus what you see with clang<br class="">9.0.0)?<br class=""></blockquote><br class="">This is trunk.  On NetBSD, it's tested using a single tree with<br class="">cxx_under_test being pointed to just-built clang.  On Gentoo, I was<br class="">testing out-of-source build against ~same revision of trunk (± delay<br class="">between fetching the two repos separately).<br class=""><br class="">And yes, I'm surprised that Debian buildbots don't hit this.<br class=""></blockquote><br class="">So you're hitting that with Clang trunk? This is not the kind of problem where the platform should matter, only the compiler and the libc++ version. Let me try to reproduce locally.<br class=""></blockquote><br class="">Yes, I can reproduce locally with Clang trunk. I think this isn't showing up in the Linux bots because they use older compilers. This must be something that was introduced recently-ish. I'll bisect.<br class=""><br class=""></blockquote><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline" class="">Oh, and I was wondering if everybody had to hack in just-built clang</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline" class="">like I did ;-).  Thanks for looking into it.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline" class="">--<span class="gmail-m_-4213072650819352593Apple-converted-space"> </span></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline" class="">Best regards,</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline" class="">Michał Górny</span></div></blockquote></div><br class=""></div></div></blockquote></div></div></div></div>
</div></blockquote></div><br class=""></div></div></div></div></div></body></html>