PR c++/57041
* decl.c (reshape_init_class): Handle error_mark_node.
From-SVN: r198844
2013-05-13 Jason Merrill <jason@redhat.com>
+ PR c++/57041
+ * decl.c (reshape_init_class): Handle error_mark_node.
+
PR c++/57254
* typeck.c (merge_types): Propagate ref-qualifier
in METHOD_TYPE case.
/* Handle designated initializers, as an extension. */
if (d->cur->index)
{
+ if (d->cur->index == error_mark_node)
+ return error_mark_node;
+
if (TREE_CODE (d->cur->index) == INTEGER_CST)
{
if (complain & tf_error)
--- /dev/null
+// PR c++/57041
+// { dg-options "-std=gnu++11" }
+// { dg-prune-output "error:" }
+
+template<typename T>
+union u {
+ T a;
+ char b;
+};
+
+template<typename T>
+u<T> make_u(T t) {
+ return { .a = t };
+}
+
+int main() {
+ return make_u<int>(1).a;
+}