<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 16, 2014 at 5:46 AM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Tim,<br>
<br>
I'm moving this to cfe-dev (this is a frontend issue). When pinging an issue, it helps to provide a brief synopsis of the problem...<br>
<br>
Looking at this briefly, the question seems to center on whether clang should support converting from T to _Atomic(T) for non-POD (but trivially copyable) types. Currently it does not, but the libc++ implementation of atomic<T> is based on _Atomic(T) and inherits this restriction, rendering it non-conforming. Howard had created a libc++ patch to change the implementation of atomic<T> so that it was not directly based on _Atomic(T), but noted that a clang change could also fix the issue. Looking at Howard's patch, I can understand his hesitation (it certainly makes the implementation more complicated).<br>
</blockquote><div><br></div><div>As I understand things, the intent was that it should be possible to</div><div><br></div><div>  #define _Atomic(T) std::atomic<T></div><div><br></div><div>when using C headers from C++ programs, and that level of equivalence would naturally extend to imply that _Atomic(T) should allow non-POD but trivially-copyable types in the cases where std::atomic<T> does. Further, I think any checking of whether a type is POD is essentially a mistake: the notion of POD has been nearly entirely expunged from the C++ language at this point.</div>
<div><br></div><div>So... my preference is to fix this in Clang. I think we're just missing the relevant initialization (and probably overload resolution) code to allow initiailzation of _Atomic(T) from T in these cases.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 -Hal<br>
<div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
> From: "Tim Blechmann" <<a href="mailto:tim@klingt.org">tim@klingt.org</a>><br>
> To: <a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>
> Sent: Sunday, July 13, 2014 5:32:01 AM<br>
> Subject: *****SPAM*****[LLVMdev] pinging 18097: atomic<> of trivially copyable class is       rejected<br>
><br>
> hi all,<br>
><br>
> bug 18097 has already been discussed on this list more than a year<br>
> ago,<br>
> and it is open with a patch attached since last autumn ... despite<br>
> being<br>
> tagged as release blocker. is there any estimation when this issue<br>
> will<br>
> be fixed?<br>
><br>
> tia,<br>
> tim<br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></span></blockquote></div><br></div></div>