Commit 8d0d49f8 by Jason Merrill Committed by Jason Merrill

PR c++/85092 - C++17 ICE with unused list constructor.

	* call.c (conv_binds_ref_to_prvalue): Also count ck_identity
	from a TARGET_EXPR.

From-SVN: r259052
parent fe736ffd
2018-04-03 Jason Merrill <jason@redhat.com>
PR c++/85092 - C++17 ICE with unused list constructor.
* call.c (conv_binds_ref_to_prvalue): Also count ck_identity
from a TARGET_EXPR.
PR c++/85113 - ICE with constexpr and __builtin_constant_p.
* constexpr.c (cxx_eval_builtin_function_call): Only defer
__builtin_constant_p if ctx->quiet.
......
......@@ -7611,6 +7611,9 @@ conv_binds_ref_to_prvalue (conversion *c)
return true;
if (c->kind == ck_user && TREE_CODE (c->type) != REFERENCE_TYPE)
return true;
if (c->kind == ck_identity && c->u.expr
&& TREE_CODE (c->u.expr) == TARGET_EXPR)
return true;
return false;
}
......
// PR c++/85092
// { dg-do compile { target c++11 } }
#include <initializer_list>
struct A
{
A (std::initializer_list<char>);
};
A f ();
A a { f () };
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