This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR/68089: C++-11: Ingore "alignas(0)".
- From: Martin Sebor <msebor at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org, vogt at linux dot vnet dot ibm dot com
- Cc: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Fri, 01 Jan 2016 17:53:08 -0700
- Subject: Re: [PATCH] PR/68089: C++-11: Ingore "alignas(0)".
- Authentication-results: sourceware.org; auth=none
- References: <20151231115039 dot GA31709 at linux dot vnet dot ibm dot com>
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).
Also, in the test, I noticed the definition of the first struct
is missing the terminating semicolon.
Martin
[*] Such as in the following:
template <int N> struct A { alignas (N) int i; };
A<0> a3;