<html><body>
<p><font size="2" face="sans-serif">Hi Hubert,<br>
</font><br>
<font size="2" face="sans-serif">Yes, I'll take a look.<br>
</font><br>
<font size="2" face="sans-serif">Thanks,</font><br>
<br>
<font size="2" face="sans-serif">Rachel</font><br>
<br>
<img width="16" height="16" src="cid:1__=0ABBF426DFCE9D1A8f9e8a93df938@ca.ibm.com" border="0" alt="Inactive hide details for Hubert Tong ---09/02/2015 05:02:26 PM---Hi Rachel, I believe you might be interested in picking this "><font size="2" color="#424282" face="sans-serif">Hubert Tong ---09/02/2015 05:02:26 PM---Hi Rachel, I believe you might be interested in picking this one up?</font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From: </font><font size="1" face="sans-serif">Hubert Tong <hubert.reinterpretcast@gmail.com></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To: </font><font size="1" face="sans-serif">Rachel Craik/Toronto/IBM@IBMCA</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Cc: </font><font size="1" face="sans-serif">Richard Smith <richard@metafoo.co.uk>, Clang Dev <cfe-dev@lists.llvm.org></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date: </font><font size="1" face="sans-serif">09/02/2015 05:02 PM</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject: </font><font size="1" face="sans-serif">Re: [cfe-dev] _Atomic qualified types and template argument deduction</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<font size="3" face="serif">Hi Rachel,<br>
</font><br>
<font size="3" face="serif">I believe you might be interested in picking this one up?<br>
</font><br>
<font size="3" face="serif">-- HT</font><br>
<br>
<font size="3" face="serif">On Wed, Sep 2, 2015 at 1:52 PM, Richard Smith <</font><a href="mailto:richard@metafoo.co.uk" target="_blank"><font size="3" color="#0000FF" face="serif"><u>richard@metafoo.co.uk</u></font></a><font size="3" face="serif">> wrote:</font>
<ul style="padding-left: 9pt"><font size="3" face="serif">On Wed, Sep 2, 2015 at 9:29 AM, Hubert Tong via cfe-dev <</font><a href="mailto:cfe-dev@lists.llvm.org" target="_blank"><font size="3" color="#0000FF" face="serif"><u>cfe-dev@lists.llvm.org</u></font></a><font size="3" face="serif">> wrote:</font>
<ul style="padding-left: 9pt"><font size="3" face="serif">In C11, the lvalue conversions replace atomic types with the unqualified, non-atomic version. This is similar to the array-to-pointer and function-to-pointer conversions in C++.<br>
</font><br>
<font size="3" face="serif">I believe that this parallel should be reflected in template argument deduction (specifically, in the place in [temp.deduct.call] where array-to-pointer and function-to-pointer conversion is mentioned).</font><br>
<font size="3" face="serif"><br>
That is, I believe the following should compile successfully (Clang doesn't do so at this time):</font><tt><font size="3"><br>
extern _Atomic const int x;<br>
template <typename T> struct C { typedef T type; };<br>
template <typename T> C<T> foo(T);<br>
extern decltype(foo(x))::type chk;<br>
extern int chk;</font></tt><br>
<font size="3" face="serif"><br>
Comments welcome.</font></ul>
<br>
<font size="3" face="serif">I agree. The intent of [temp.deduct.call]p2 and p3 seems to be that if P is not a reference, then A is replaced by the type obtained by converting A to a prvalue (and dropping qualifiers). Whether we view _Atomic as a funny kind of qualifier or as a funny kind of modifier that decays to its underlying type, we should deduce T = int in your above example.</font></ul>
<br>
</body></html>