On 01/04/2016 04:33 AM, Dominik Vogt wrote:
On Fri, Jan 01, 2016 at 05:53:08PM -0700, Martin Sebor wrote:
On 12/31/2015 04:50 AM, Dominik Vogt wrote:
The attached patch fixes C++-11 handling of "alignas(0)" which
should be ignored but currently generates an error message.  A
test case is included; the patch has been tested on S390x.  Since
it's a language issue it should be independent of the backend
used.

The patch doesn't handle value-dependent expressions(*).

It
seems that the problem is in handle_aligned_attribute() calling
check_user_alignment() with the second argument (ALLOW_ZERO)
set to false.  Calling it with true fixes the problem and handles
value-dependent expressions (I haven't done any more testing beyond
that).

Like the attached patch?  (Passes the testsuite on s390x.)

Yes, like that (though someone other than me needs to approve
your patch).


But wouldn't an "aligned" attribute be added, allowing the backend
to possibly generate an error or a warning?

AFAICS, both the C and C++ front ends ignore the attribute
when check_user_alignment() returns -1 (either on error or
when the requested alignment is zero and ALLOW_ZERO is true).

Martin

PS I wonder what it is about this thread that makes my email
client (Thunderbird) include only gcc-patches and krebbel
when I hit Reply All and not you.  (I had to manually add
your email.)  It looks like your reply back to me did the
same thing.

Martin

Reply via email to