Commit a41bb2c9 by Jason Merrill Committed by Jason Merrill

re PR c++/63405 (ICE in cp_perform_integral_promotions, at cp/typeck.c:2084)

	PR c++/63405
	* pt.c (tsubst_pack_expansion): Limit simple expansion to type packs.

From-SVN: r216013
parent 024da309
2014-10-08 Jason Merrill <jason@redhat.com> 2014-10-08 Jason Merrill <jason@redhat.com>
PR c++/63405
* pt.c (tsubst_pack_expansion): Limit simple expansion to type packs.
PR c++/63485 PR c++/63485
* tree.c (build_cplus_array_type): Look for a type with no * tree.c (build_cplus_array_type): Look for a type with no
typedef-name or attributes. typedef-name or attributes.
......
...@@ -9929,7 +9929,13 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, ...@@ -9929,7 +9929,13 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
/* If the expansion is just T..., return the matching argument pack. */ /* If the expansion is just T..., return the matching argument pack. */
if (!unsubstituted_packs if (!unsubstituted_packs
&& TREE_PURPOSE (packs) == pattern) && TREE_PURPOSE (packs) == pattern)
return ARGUMENT_PACK_ARGS (TREE_VALUE (packs)); {
tree args = ARGUMENT_PACK_ARGS (TREE_VALUE (packs));
if (TREE_CODE (t) == TYPE_PACK_EXPANSION
|| pack_expansion_args_count (args))
return args;
/* Otherwise use the normal path so we get convert_from_reference. */
}
/* We cannot expand this expansion expression, because we don't have /* We cannot expand this expansion expression, because we don't have
all of the argument packs we need. */ all of the argument packs we need. */
......
// PR c++/63405
// { dg-do compile { target c++11 } }
template <typename _Tp> _Tp forward(_Tp);
template <typename Args> struct Format { Format(int, Args); };
template <typename... Args> auto format(Args &&... args) -> Format<Args...> {
return {0, args...};
}
template <typename... Args> void msg(Args... args) {
format(forward(args)...);
}
void some_function() { msg('x'); }
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