<div dir="ltr"><div><div>Hi Rachel,<br><br></div>I believe you might be interested in picking this one up?<br><br></div>-- HT<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 2, 2015 at 1:52 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Wed, Sep 2, 2015 at 9:29 AM, Hubert Tong via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>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><br></div>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).<br><div><div><div><br>That is, I believe the following should compile successfully (Clang doesn't do so at this time):<br><span style="font-family:monospace,monospace">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;</span><br></div><div><br>Comments welcome.</div></div></div></div></blockquote><div><br></div></div></div><div>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.</div></div></div></div>
</blockquote></div><br></div>