This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] c++/58109 - alignas() fails to compile with constant expression
- From: Martin Sebor <msebor at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 12 Jan 2016 11:11:32 -0700
- Subject: Re: [PATCH] c++/58109 - alignas() fails to compile with constant expression
- Authentication-results: sourceware.org; auth=none
- References: <567A07A0 dot 1010008 at gmail dot com> <56948D1B dot 4030403 at redhat dot com>
On 01/11/2016 10:20 PM, Jason Merrill wrote:
On 12/22/2015 09:32 PM, Martin Sebor wrote:
+ if (is_attribute_p ("aligned", name)
+ || is_attribute_p ("vector_size", name))
+ {
+ /* Attribute argument may be a dependent indentifier. */
+ if (tree t = args ? TREE_VALUE (args) : NULL_TREE)
+ if (value_dependent_expression_p (t)
+ || type_dependent_expression_p (t))
+ return true;
+ }
Instead of this, is_late_template_attribute should be fixed to check
attribute_takes_identifier_p.
attribute_takes_identifier_p() returns false for the aligned
attribute and for vector_size (it returns true only for
attributes cleanup, format, and mode, and none others).
Are you suggesting to also change attribute_takes_identifier_p
to return true for these attributes? That would likely mean
changes to the C front end as well.)
Thanks
Martin