Commit 14e51ef2 by Marek Polacek Committed by Marek Polacek

re PR middle-end/65554 (ICE: verify_gimple failed)

	PR c++/65554
	* class.c (finish_struct): Require that the second field of a
	user-defined initializer_list be of size type.

	* g++.dg/cpp0x/initlist93.C: New test.
	* g++.dg/cpp0x/initlist94.C: New test.

From-SVN: r221808
parent 0ff2bf46
2015-04-01 Marek Polacek <polacek@redhat.com>
PR c++/65554
* class.c (finish_struct): Require that the second field of a
user-defined initializer_list be of size type.
2015-03-31 Marek Polacek <polacek@redhat.com>
PR c++/65390
......
......@@ -6891,7 +6891,7 @@ finish_struct (tree t, tree attributes)
if (f && TREE_CODE (TREE_TYPE (f)) == POINTER_TYPE)
{
f = next_initializable_field (DECL_CHAIN (f));
if (f && TREE_CODE (TREE_TYPE (f)) == INTEGER_TYPE)
if (f && same_type_p (TREE_TYPE (f), size_type_node))
ok = true;
}
}
......
2015-04-01 Marek Polacek <polacek@redhat.com>
PR c++/65554
* g++.dg/cpp0x/initlist93.C: New test.
* g++.dg/cpp0x/initlist94.C: New test.
2015-04-01 Max Ostapenko <m.ostapenko@partner.samsung.com>
PR target/65624
......
// PR c++/65554
// { dg-do compile { target c++11 } }
namespace std
{
template <class> class initializer_list // { dg-error "definition of std::initializer_list does not match" }
{
int *_M_array;
int _M_len;
};
}
// { dg-prune-output "compilation terminated" }
// PR c++/65554
// { dg-do compile { target c++11 } }
typedef decltype (sizeof (int)) size_type;
namespace std
{
template <class> class initializer_list
{
int *_M_array;
size_type _M_len;
};
}
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