+016-02-24 Martin Sebor <msebor@redhat.com>
+
+ PR c++/69912
+ * tree.c (build_ctor_subob_ref): Compare types' main variants
+ instead of the types as they are.
+
2016-02-24 Jason Merrill <jason@redhat.com>
* decl.c (start_preparsed_function): Condition ctor clobber on
{
/* When the destination object refers to a flexible array member
verify that it matches the type of the source object except
- for its domain. */
- gcc_assert (comptypes (type, objtype, COMPARE_REDECLARATION));
+ for its domain and qualifiers. */
+ gcc_assert (comptypes (TYPE_MAIN_VARIANT (type),
+ TYPE_MAIN_VARIANT (objtype),
+ COMPARE_REDECLARATION));
}
else
gcc_assert (same_type_ignoring_top_level_qualifiers_p (type, objtype));
2016-02-24 Martin Sebor <msebor@redhat.com>
- * gcc/testsuite/gcc.dg/builtins-68.c: Avoid making unportable
+ PR c++/69912
+ * g++.dg/ext/flexary15.C: New test.
+
+2016-02-24 Martin Sebor <msebor@redhat.com>
+
+ * gcc.dg/builtins-68.c: Avoid making unportable
assumptions about the relationship between SIZE_MAX and UINT_MAX.
- * gcc/testsuite/g++.dg/ext/builtin_alloca.C: Same.
+ * g++.dg/ext/builtin_alloca.C: Same.
2016-02-24 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Charles Baylis <charles.baylis@linaro.org>
--- /dev/null
+// PR c++/69912 - [6 regression] ICE in build_ctor_subob_ref initializing
+// a flexible array member
+// { dg-do compile }
+// { dg-options "-Wno-pedantic -Wno-write-strings -fpermissive" }
+
+struct S {
+ int n;
+ char *a[];
+};
+
+void foo (const char *a)
+{
+ const S s = { 1, { a, "b" } }; // { dg-warning "invalid conversion" }
+}