Commit 010bc40a by Jason Merrill Committed by Jason Merrill

re PR c++/60848 (Crash while experimenting with c++-0x initializer lists)

	PR c++/60848
	* call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.

From-SVN: r211179
parent 616abc64
2014-06-03 Jason Merrill <jason@redhat.com>
PR c++/60848
* call.c (is_std_init_list): Check CLASSTYPE_TEMPLATE_INFO.
2014-06-02 Jason Merrill <jason@redhat.com>
PR c++/61046
......
......@@ -9675,6 +9675,7 @@ is_std_init_list (tree type)
type = TYPE_MAIN_VARIANT (type);
return (CLASS_TYPE_P (type)
&& CP_TYPE_CONTEXT (type) == std_node
&& CLASSTYPE_TEMPLATE_INFO (type)
&& strcmp (TYPE_NAME_STRING (type), "initializer_list") == 0);
}
......
// PR c++/60848
// { dg-do compile { target c++11 } }
namespace std
{
struct initializer_list {};
}
void foo(std::initializer_list &);
void f()
{
foo({1, 2}); // { dg-error "" }
}
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