<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 12, 2011, at 2:56 PM, Howard Hinnant wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: hhinnant<br>Date: Wed Jan 12 16:56:59 2011<br>New Revision: 123337<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=123337&view=rev">http://llvm.org/viewvc/llvm-project?rev=123337&view=rev</a><br>Log:<br>Fixing an ambiguity in variadics found by clang.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><div><br></div>For our spectators... GCC allows this code, Clang rejects it as an ambiguity, and it's not clear exactly what's right given core issue 692.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div><div><br><blockquote type="cite"><div>Modified:<br> libcxx/trunk/include/mutex<br><br>Modified: libcxx/trunk/include/mutex<br>URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/mutex?rev=123337&r1=123336&r2=123337&view=diff">http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/mutex?rev=123337&r1=123336&r2=123337&view=diff</a><br>==============================================================================<br>--- libcxx/trunk/include/mutex (original)<br>+++ libcxx/trunk/include/mutex Wed Jan 12 16:56:59 2011<br>@@ -364,9 +364,9 @@<br><br> #ifndef _LIBCPP_HAS_NO_VARIADICS<br><br>-template <class _L0, class _L1, class ..._L2><br>+template <class _L0, class _L1, class _L2, class ..._L3><br> void<br>-__lock_first(int __i, _L0& __l0, _L1& __l1, _L2& ...__l2)<br>+__lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)<br> {<br> while (true)<br> {<br>@@ -375,7 +375,7 @@<br> case 0:<br> {<br> unique_lock<_L0> __u0(__l0);<br>- __i = try_lock(__l1, __l2...);<br>+ __i = try_lock(__l1, __l2, __l3...);<br> if (__i == -1)<br> {<br> __u0.release();<br>@@ -388,32 +388,32 @@<br> case 1:<br> {<br> unique_lock<_L1> __u1(__l1);<br>- __i = try_lock(__l2..., __l0);<br>+ __i = try_lock(__l2, __l3..., __l0);<br> if (__i == -1)<br> {<br> __u1.release();<br> return;<br> }<br> }<br>- if (__i == sizeof...(_L2))<br>+ if (__i == sizeof...(_L3) + 1)<br> __i = 0;<br> else<br> __i += 2;<br> sched_yield();<br> break;<br> default:<br>- __lock_first(__i - 2, __l2..., __l0, __l1);<br>+ __lock_first(__i - 2, __l2, __l3..., __l0, __l1);<br> return;<br> }<br> }<br> }<br><br>-template <class _L0, class _L1, class ..._L2><br>+template <class _L0, class _L1, class _L2, class ..._L3><br> inline _LIBCPP_INLINE_VISIBILITY<br> void<br>-lock(_L0& __l0, _L1& __l1, _L2& ...__l2)<br>+lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)<br> {<br>- __lock_first(0, __l0, __l1, __l2...);<br>+ __lock_first(0, __l0, __l1, __l2, __l3...);<br> }<br><br> #endif // _LIBCPP_HAS_NO_VARIADICS<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></div></blockquote></div><br></body></html>