Commit 68218b64 by Jason Merrill Committed by Jason Merrill

PR c++/84665 - ICE with array of empty class.

	* decl2.c (cp_check_const_attributes): Use fold_non_dependent_expr.

From-SVN: r259132
parent 4cbe585c
2018-04-05 Jason Merrill <jason@redhat.com> 2018-04-05 Jason Merrill <jason@redhat.com>
PR c++/84665 - ICE with array of empty class.
* decl2.c (cp_check_const_attributes): Use fold_non_dependent_expr.
PR c++/85228 - ICE with lambda in enumerator in template. PR c++/85228 - ICE with lambda in enumerator in template.
* pt.c (bt_instantiate_type_proc): Don't assume * pt.c (bt_instantiate_type_proc): Don't assume
CLASSTYPE_TEMPLATE_INFO is non-null. CLASSTYPE_TEMPLATE_INFO is non-null.
......
...@@ -1416,7 +1416,7 @@ cp_check_const_attributes (tree attributes) ...@@ -1416,7 +1416,7 @@ cp_check_const_attributes (tree attributes)
{ {
tree expr = TREE_VALUE (arg); tree expr = TREE_VALUE (arg);
if (EXPR_P (expr)) if (EXPR_P (expr))
TREE_VALUE (arg) = maybe_constant_value (expr); TREE_VALUE (arg) = fold_non_dependent_expr (expr);
} }
} }
} }
......
// PR c++/84665
struct S {} a[1];
template <int N>
void
foo ()
{
__attribute__ ((noinline (a[0]))) int c = 0; // { dg-error "wrong number of arguments" }
}
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