[cfe-dev] _Atomic qualified types and template argument deduction
Hubert Tong via cfe-dev
cfe-dev at lists.llvm.org
Wed Sep 2 09:29:37 PDT 2015
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++.
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).
That is, I believe the following should compile successfully (Clang doesn't
do so at this time):
extern _Atomic const int x;
template <typename T> struct C { typedef T type; };
template <typename T> C<T> foo(T);
extern decltype(foo(x))::type chk;
extern int chk;
Comments welcome.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150902/98e955f8/attachment.html>
More information about the cfe-dev
mailing list