* call.c (conv_binds_ref_to_prvalue): Also count ck_identity
from a TARGET_EXPR.
From-SVN: r259052
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.
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;
}
--- /dev/null
+// PR c++/85092
+// { dg-do compile { target c++11 } }
+
+#include <initializer_list>
+
+struct A
+{
+ A (std::initializer_list<char>);
+};
+
+A f ();
+
+A a { f () };