Commit 43f638e8 authored by jason's avatar jason

PR c++/86480 - nested variadic lambda and constexpr if.

	* pt.c (find_parameter_packs_r) [IF_STMT]: Don't walk into
	IF_STMT_EXTRA_ARGS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-8-branch@262858 138bc75d-0d04-0410-961f-82ee72b054a4
parent 2f2d8153
2018-07-17 Jason Merrill <jason@redhat.com>
PR c++/86480 - nested variadic lambda and constexpr if.
* pt.c (find_parameter_packs_r) [IF_STMT]: Don't walk into
IF_STMT_EXTRA_ARGS.
2018-07-16 Jakub Jelinek <jakub@redhat.com>
PR c++/3698
......
......@@ -3867,6 +3867,17 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
return NULL_TREE;
}
case IF_STMT:
cp_walk_tree (&IF_COND (t), &find_parameter_packs_r,
ppd, ppd->visited);
cp_walk_tree (&THEN_CLAUSE (t), &find_parameter_packs_r,
ppd, ppd->visited);
cp_walk_tree (&ELSE_CLAUSE (t), &find_parameter_packs_r,
ppd, ppd->visited);
/* Don't walk into IF_STMT_EXTRA_ARGS. */
*walk_subtrees = 0;
return NULL_TREE;
default:
return NULL_TREE;
}
......
// PR c++/86480
// { dg-additional-options -std=c++17 }
template <class...> constexpr bool val = true;
template <class... T>
void f()
{
[](auto... p)
{
[=]{
if constexpr (val<T..., decltype(p)...>) { return true; }
return false;
}();
}(42);
}
int main()
{
f<int>();
}
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