<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Mar 9, 2014 at 9:50 PM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: marshall<br>
Date: Sun Mar  9 23:50:10 2014<br>
New Revision: 203443<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=203443&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=203443&view=rev</a><br>
Log:<br>
Fix bug I introduced (enabling implicit conversions from compare function to map) in r202994. Thanks to Sebastian Redl for the catch.<br>
<br>
Modified:<br>
    libcxx/trunk/include/map<br>
    libcxx/trunk/include/set<br>
<br>
Modified: libcxx/trunk/include/map<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/map?rev=203443&r1=203442&r2=203443&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/map?rev=203443&r1=203442&r2=203443&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/include/map (original)<br>
+++ libcxx/trunk/include/map Sun Mar  9 23:50:10 2014<br>
@@ -835,7 +835,15 @@ public:<br>
     typedef _VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;<br>
<br>
     _LIBCPP_INLINE_VISIBILITY<br>
-    map(const key_compare& __comp = key_compare())<br>
+    map()<br>
+        _NOEXCEPT_(<br>
+            is_nothrow_default_constructible<allocator_type>::value &&<br>
+            is_nothrow_default_constructible<key_compare>::value &&<br>
+            is_nothrow_copy_constructible<key_compare>::value)<br>
+        : __tree_(__vc(key_compare())) {}<br>
+<br>
+    _LIBCPP_INLINE_VISIBILITY<br>
+    explicit map(const key_compare& __comp)<br>
         _NOEXCEPT_(<br>
             is_nothrow_default_constructible<allocator_type>::value &&<br>
             is_nothrow_default_constructible<key_compare>::value &&<br></blockquote><div><br></div><div>The is_nothrow_default_constructible<key_compare>::value here looks unnecessary; we don't default construct a key_compare here any more.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -1568,7 +1576,15 @@ public:<br>
     typedef _VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;<br>
<br>
     _LIBCPP_INLINE_VISIBILITY<br>
-    multimap(const key_compare& __comp = key_compare())<br>
+    multimap()<br>
+        _NOEXCEPT_(<br>
+            is_nothrow_default_constructible<allocator_type>::value &&<br>
+            is_nothrow_default_constructible<key_compare>::value &&<br>
+            is_nothrow_copy_constructible<key_compare>::value)<br>
+        : __tree_(__vc(key_compare())) {}<br>
+<br>
+    _LIBCPP_INLINE_VISIBILITY<br>
+    explicit multimap(const key_compare& __comp)<br>
         _NOEXCEPT_(<br>
             is_nothrow_default_constructible<allocator_type>::value &&<br>
             is_nothrow_default_constructible<key_compare>::value &&<br></blockquote><div><br></div><div>Likewise.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Modified: libcxx/trunk/include/set<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/set?rev=203443&r1=203442&r2=203443&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/set?rev=203443&r1=203442&r2=203443&view=diff</a><br>

==============================================================================<br>
--- libcxx/trunk/include/set (original)<br>
+++ libcxx/trunk/include/set Sun Mar  9 23:50:10 2014<br>
@@ -425,12 +425,21 @@ public:<br>
     typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;<br>
<br>
     _LIBCPP_INLINE_VISIBILITY<br>
-    set(const value_compare& __comp = value_compare())<br>
+    set()<br>
+        _NOEXCEPT_(<br>
+            is_nothrow_default_constructible<allocator_type>::value &&<br>
+            is_nothrow_default_constructible<key_compare>::value &&<br>
+            is_nothrow_copy_constructible<key_compare>::value)<br>
+        : __tree_(value_compare()) {}<br>
+<br>
+    _LIBCPP_INLINE_VISIBILITY<br>
+    explicit set(const value_compare& __comp)<br>
         _NOEXCEPT_(<br>
             is_nothrow_default_constructible<allocator_type>::value &&<br>
             is_nothrow_default_constructible<key_compare>::value &&<br></blockquote><div><br></div><div>... and here. (Seems weird to use value_compare in the parameter and key_compare in the exception specification, too...)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
             is_nothrow_copy_constructible<key_compare>::value)<br>
         : __tree_(__comp) {}<br>
+<br>
     _LIBCPP_INLINE_VISIBILITY<br>
     explicit set(const value_compare& __comp, const allocator_type& __a)<br>
         : __tree_(__comp, __a) {}<br>
@@ -822,12 +831,21 @@ public:<br>
<br>
     // construct/copy/destroy:<br>
     _LIBCPP_INLINE_VISIBILITY<br>
-    multiset(const value_compare& __comp = value_compare())<br>
+    multiset()<br>
+        _NOEXCEPT_(<br>
+            is_nothrow_default_constructible<allocator_type>::value &&<br>
+            is_nothrow_default_constructible<key_compare>::value &&<br>
+            is_nothrow_copy_constructible<key_compare>::value)<br>
+        : __tree_(value_compare()) {}<br>
+<br>
+    _LIBCPP_INLINE_VISIBILITY<br>
+    explicit multiset(const value_compare& __comp)<br>
         _NOEXCEPT_(<br>
             is_nothrow_default_constructible<allocator_type>::value &&<br>
             is_nothrow_default_constructible<key_compare>::value &&<br></blockquote><div><br></div><div>Likewise.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

             is_nothrow_copy_constructible<key_compare>::value)<br>
         : __tree_(__comp) {}<br>
+<br>
     _LIBCPP_INLINE_VISIBILITY<br>
     explicit multiset(const value_compare& __comp, const allocator_type& __a)<br>
         : __tree_(__comp, __a) {}<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>