This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [C++ PATCH, RFC] PR c++/63959, continued
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org
- Date: Fri, 30 Jan 2015 20:13:41 +0200
- Subject: Re: [C++ PATCH, RFC] PR c++/63959, continued
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUYhAnLjFc8mcTfiheJAr4R6E1mdx32PTqZJ5EpPt8=4aQ at mail dot gmail dot com> <CAFk2RUY8Xwx3RvoPGgas4eO4wOvvS+cqh6acp6uBStjdKwS2GA at mail dot gmail dot com> <CAFk2RUZ_jfxKj0aFfW4D0K0O402RXjFx6yEYM2iVTr5f61iNTA at mail dot gmail dot com> <54BE52DE dot 5080603 at redhat dot com> <CAFk2RUZ3rAxTSwnO44JycT_+r_DSY8a1w5LSi8bE+JPcdFiX1A at mail dot gmail dot com> <54CBC38A dot 8020902 at redhat dot com>
On 30 January 2015 at 19:46, Jason Merrill <jason@redhat.com> wrote:
> On 01/20/2015 09:27 AM, Ville Voutilainen wrote:
>>
>> +#define YES2(type) TRY(std::is_trivial<type>::value); \
>> + TRY(std::is_trivial<type[]>::value); \
>> TRY(std::is_trivial<const volatile type>::value)
>
>
>> +YES2(void *);
>> +YES2(int A::*);
>
>
> Why would void *const volatile still be trivial?
Arrrrggggh. It isn't. YES and YES2 are macros, so YES2(void*) expands to
is_trivial<const volatile void*>::value, which is true, whereas
is_trivial<void* const volatile>::value is false.
I think it would be reasonable to convert these macros in that test into
function templates, no? :)