Commit 1ed3dfd5 by Giovanni Bajo

re PR c++/10479 (alignof and sizeof (and other expressions) in attributes does…

re PR c++/10479 (alignof and sizeof (and other expressions) in attributes does not compile inside template classes)

	PR c++/10479
	* parser.c (cp_parser_parenthesized_expression_list): Fold
	non-dependent expressions in attribute lists.

	PR c++/10479
	* g++.dg/ext/attrib16.C: New test.

From-SVN: r89135
parent 29c431a1
2004-10-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/10479
* parser.c (cp_parser_parenthesized_expression_list): Fold
non-dependent expressions in attribute lists.
2004-10-15 Mark Mitchell <mark@codesourcery.com>
PR c++/17042
......
......@@ -4420,6 +4420,7 @@ cp_parser_parenthesized_expression_list (cp_parser* parser,
bool *non_constant_p)
{
tree expression_list = NULL_TREE;
bool fold_expr_p = is_attribute_list;
tree identifier = NULL_TREE;
/* Assume all the expressions will be constant. */
......@@ -4462,6 +4463,9 @@ cp_parser_parenthesized_expression_list (cp_parser* parser,
else
expr = cp_parser_assignment_expression (parser);
if (fold_expr_p)
expr = fold_non_dependent_expr (expr);
/* Add it to the list. We add error_mark_node
expressions to the list, so that we can still tell if
the correct form for a parenthesized expression-list
......
2004-10-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/10479
* g++.dg/ext/attrib16.C: New test.
2004-10-15 Mark Mitchell <mark@codesourcery.com>
PR c++/17042
......
// { dg-do compile }
// Origin: <rguenth at tat dot physik dot uni-tuebingen dot de>
// PR c++/10479: use of non dependent expressions in attributes in templates
template <int i>
struct foo2 {
float bar __attribute__((aligned(__alignof__(double))));
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment