Commit 8f712b76 by Jason Merrill Committed by Jason Merrill

PR c++/78282 - auto template and pack expansion

	* pt.c (find_parameter_packs_r): Don't walk into the type of
	templates other than template template-parameters.

From-SVN: r245594
parent bcbdfa4c
2017-02-19 Jason Merrill <jason@redhat.com>
PR c++/78282 - auto template and pack expansion
* pt.c (find_parameter_packs_r): Don't walk into the type of
templates other than template template-parameters.
PR c++/79606 - ICE with this->base_member in NSDMI
* class.c (build_base_path): Check processing_template_decl.
......
......@@ -3576,8 +3576,12 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
*walk_subtrees = 0;
return NULL_TREE;
case CONSTRUCTOR:
case TEMPLATE_DECL:
if (!DECL_TEMPLATE_TEMPLATE_PARM_P (t))
return NULL_TREE;
gcc_fallthrough();
case CONSTRUCTOR:
cp_walk_tree (&TREE_TYPE (t),
&find_parameter_packs_r, ppd, ppd->visited);
return NULL_TREE;
......
// PR c++/78282
// { dg-do compile { target c++14 } }
struct null_node
{
null_node(const null_node&);
};
extern null_node null;
template <typename T>
auto get() { return null; }
template <typename... Ts>
struct inheritor: Ts...
{
inheritor(const inheritor& outer)
: Ts(get<Ts...>())...
{ }
};
void test()
{
extern inheritor<null_node> example;
inheritor<null_node> result(example);
}
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