[cfe-dev] libc++: help diagnosing the following std::atomic compile error
Richard Smith
richard at metafoo.co.uk
Mon May 20 15:02:43 PDT 2013
On Mon, May 20, 2013 at 3:00 PM, Howard Hinnant <hhinnant at apple.com> wrote:
> On May 20, 2013, at 5:49 PM, Richard Smith <richard at metafoo.co.uk> wrote:
>
> > One thing to be cautious about:
> >
> > struct T { char c[3]; };
> > static_assert(sizeof(std::atomic<T>) == 3 && alignof(std::atomic<T>) ==
> 1, "under libstdc++");
> > static_assert(sizeof(std::atomic<T>) == 4 && alignof(std::atomic<T>) ==
> 4, "under libc++");
>
> Here's what I'm currently testing:
>
> template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp,
> bool>::value>
> struct __atomic_base // false
> {
> _ALIGNAS_TYPE(_Atomic(_Tp)) _Tp __a_;
>
> where _ALIGNAS_TYPE(x) will become alignas(x).
>
> Does that look good to you?
Yup, LGTM.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130520/ed923e32/attachment.html>
More information about the cfe-dev
mailing list