* decl2.c (finish_anon_union): Use cp_finish_decl.
* error.c (dump_function_name): Avoid showing anonymous "name".
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186432
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-04-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/52915
+ * decl2.c (finish_anon_union): Use cp_finish_decl.
+ * error.c (dump_function_name): Avoid showing anonymous "name".
+
2012-04-11 Fabien ChĂȘne <fabien@gcc.gnu.org>
PR c++/52465
}
pushdecl (anon_union_decl);
- if (building_stmt_list_p ()
- && at_function_scope_p ())
- add_decl_expr (anon_union_decl);
- else if (!processing_template_decl)
- rest_of_decl_compilation (anon_union_decl,
- toplevel_bindings_p (), at_eof);
+ cp_finish_decl (anon_union_decl, NULL_TREE, false, NULL_TREE, 0);
}
\f
/* Auxiliary functions to make type signatures for
{
if (LAMBDA_TYPE_P (DECL_CONTEXT (t)))
name = get_identifier ("<lambda>");
+ else if (TYPE_ANONYMOUS_P (DECL_CONTEXT (t)))
+ name = get_identifier ("<constructor>");
else
name = constructor_name (DECL_CONTEXT (t));
}
+2012-04-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/52915
+ * g++.dg/other/anon-union2.C: New.
+
2012-04-13 Martin Jambor <mjambor@suse.cz>
PR middle-end/52939
--- /dev/null
+// PR c++/52915
+
+struct S {
+ int val;
+ S(int v) : val(v) {}
+};
+
+void f() {
+ union { S a; }; // { dg-error "constructor|no match" }
+}