Commit cd0a831c by Marek Polacek Committed by Marek Polacek

PR c++/90265 - ICE with generic lambda.

	* pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
	element in the vector.

	* g++.dg/cpp1y/lambda-generic-90265.C: New test.

From-SVN: r270917
parent fd661a34
2019-05-06 Marek Polacek <polacek@redhat.com>
PR c++/90265 - ICE with generic lambda.
* pt.c (tsubst_copy_and_build): Use a dedicated variable for the last
element in the vector.
2019-05-03 Martin Liska <mliska@suse.cz> 2019-05-03 Martin Liska <mliska@suse.cz>
* call.c (build_aggr_conv): Use is_empty instead of * call.c (build_aggr_conv): Use is_empty instead of
......
...@@ -18881,7 +18881,8 @@ tsubst_copy_and_build (tree t, ...@@ -18881,7 +18881,8 @@ tsubst_copy_and_build (tree t,
if (thisarg) if (thisarg)
{ {
/* Shift the other args over to make room. */ /* Shift the other args over to make room. */
vec_safe_push (call_args, (*call_args)[nargs-1]); tree last = (*call_args)[nargs - 1];
vec_safe_push (call_args, last);
for (int i = nargs-1; i > 0; --i) for (int i = nargs-1; i > 0; --i)
(*call_args)[i] = (*call_args)[i-1]; (*call_args)[i] = (*call_args)[i-1];
(*call_args)[0] = thisarg; (*call_args)[0] = thisarg;
......
2019-05-06 Marek Polacek <polacek@redhat.com>
PR c++/90265 - ICE with generic lambda.
* g++.dg/cpp1y/lambda-generic-90265.C: New test.
2019-05-06 Richard Biener <rguenther@suse.de> 2019-05-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/90358 PR tree-optimization/90358
......
// PR c++/90265
// { dg-do compile { target c++14 } }
void (*a)(int, int, int, void *) = [](auto, auto, auto, auto) {};
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