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
+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
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
--- /dev/null
+// 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" }
--- /dev/null
+// 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;
+};
+}