PR c++/71285 - member of fold-expression

* semantics.c (finish_unary_fold_expr)
	(finish_binary_fold_expr): Use null type for fold-expressions.

From-SVN: r245340
This commit is contained in:
Jason Merrill 2017-02-10 13:24:36 -05:00 committed by Jason Merrill
parent c16b872c8f
commit f494ac0ebd
3 changed files with 18 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2017-02-10 Jason Merrill <jason@redhat.com>
PR c++/71285 - member of fold-expression
* semantics.c (finish_unary_fold_expr)
(finish_binary_fold_expr): Use null type for fold-expressions.
PR c++/79401 - protected inherited constructor
* call.c (enforce_access): For inheriting constructor, find a base
binfo in the path we already have.

View File

@ -9437,7 +9437,7 @@ finish_unary_fold_expr (tree expr, int op, tree_code dir)
// Build the fold expression.
tree code = build_int_cstu (integer_type_node, abs (op));
tree fold = build_min (dir, unknown_type_node, code, pack);
tree fold = build_min_nt_loc (UNKNOWN_LOCATION, dir, code, pack);
FOLD_EXPR_MODIFY_P (fold) = (op < 0);
return fold;
}
@ -9463,7 +9463,7 @@ finish_binary_fold_expr (tree pack, tree init, int op, tree_code dir)
{
pack = make_pack_expansion (pack);
tree code = build_int_cstu (integer_type_node, abs (op));
tree fold = build_min (dir, unknown_type_node, code, pack, init);
tree fold = build_min_nt_loc (UNKNOWN_LOCATION, dir, code, pack, init);
FOLD_EXPR_MODIFY_P (fold) = (op < 0);
return fold;
}

View File

@ -0,0 +1,12 @@
// PR c++/71285
// { dg-options -std=c++1z }
template<typename... Args>
void spurious(Args... args)
{
(... + args).member;
}
int main()
{
}