Hi Ryan.<div><br></div><div>I'd say we should implement these correctly unless something in MS's standard library relies on the incorrect behavior to function properly. The consensus seems to be that Clang has no goal to be bug-for-bug compatible with MSVC unless it prevents something from working correctly.<br>

<br><div class="gmail_quote">On Sun, Nov 4, 2012 at 5:54 PM, Ryan Molden <span dir="ltr"><<a href="mailto:ryanmolden@gmail.com" target="_blank">ryanmolden@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello, I noticed there was a proposed patch by Joćo Matos in August (<a href="http://www.mail-archive.com/cfe-commits@cs.uiuc.edu/msg55616.html" target="_blank">http://www.mail-archive.com/cfe-commits@cs.uiuc.edu/msg55616.html</a>). I don't see it in trunk so I suspect it was never committed. <div>


<br></div><div>I too need these intrinsics so I was applying the patch locally and writing some simple tests for it and noticed something strange. I thought I would ask people's opinons here as to what the right thing to do is.<div>


<br></div><div>The patch above calls out at least the following intrinsics as missing:</div><div><br></div><div>__has_nothrow_move_assign</div><div>__has_trivial_move_assign</div><div>__has_trivial_move_constructor</div>

<div>
<br></div><div>These are used in Microsoft's implementation of the following standard type traits:</div><div><br></div><div>__has_nothrow_move_assign    -> std::is_nothrow_move_assignable</div><div>__has_trivial_move_assign        -> std::is_trivially_move_assignable</div>


<div>__has_trivial_move_constructor -> std::is_trivially_move_constructible</div><div><br></div><div>The strange thing is that MSVC 2012 appears to return false for all types I have tested for __has_nothrow_move_assign and __has_trivial_move_assign. __has_trivial_move_constructor seems to be implemented properly.</div>


<div><br></div><div>If I were to implement these intrinsics in Clang would it be best to implement them correctly (i.e. as the standard dictates) or as Microsoft apparently has in the 2012 MSVC release?  It feels like the former, as I suspect Microsoft will fix these intrinsics. On the other hand if the idea is to have code yield the same result as if it had been compiled under MSVC then it seems the two intrinsics should just be 'return false'.</div>

<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Ryan</div></font></span></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Joćo Matos<br>
</div>