Commit f83fad40 by Marek Polacek Committed by Marek Polacek

PR c++/89297 - ICE with OVERLOAD in template.

	* semantics.c (finish_compound_literal): Call
	instantiate_non_dependent_expr_sfinae.

	* g++.dg/cpp0x/initlist113.C: New test.

From-SVN: r268854
parent 10839133
2019-02-13 Marek Polacek <polacek@redhat.com>
PR c++/89297 - ICE with OVERLOAD in template.
* semantics.c (finish_compound_literal): Call
instantiate_non_dependent_expr_sfinae.
2019-02-13 Alexandre Oliva <aoliva@redhat.com>
PR c++/86379
......
......@@ -2827,9 +2827,13 @@ finish_compound_literal (tree type, tree compound_literal,
return error_mark_node;
compound_literal = reshape_init (type, compound_literal, complain);
if (SCALAR_TYPE_P (type)
&& !BRACE_ENCLOSED_INITIALIZER_P (compound_literal)
&& !check_narrowing (type, compound_literal, complain))
return error_mark_node;
&& !BRACE_ENCLOSED_INITIALIZER_P (compound_literal))
{
tree t = instantiate_non_dependent_expr_sfinae (compound_literal,
complain);
if (!check_narrowing (type, t, complain))
return error_mark_node;
}
if (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_DOMAIN (type) == NULL_TREE)
{
......
2019-02-13 Marek Polacek <polacek@redhat.com>
PR c++/89297 - ICE with OVERLOAD in template.
* g++.dg/cpp0x/initlist113.C: New test.
2019-02-13 Alexandre Oliva <aoliva@redhat.com>
PR c++/86379
......
// PR c++/89297
// { dg-do compile { target c++11 } }
int id(int v) { return v; }
float id(float v) { return v; }
template <typename>
int foo(int v)
{
return int{id(v)};
}
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