2014-03-10 Jason Merrill <jason@redhat.com>
+ PR c++/60367
+ * call.c (convert_default_arg): Remove special handling for
+ CONSTRUCTOR.
+
PR c++/53492
* parser.c (cp_parser_class_head): Also check PRIMARY_TEMPLATE_P
when deciding whether to call push_template_decl for a member class.
/* We must make a copy of ARG, in case subsequent processing
alters any part of it. */
arg = break_out_target_exprs (arg);
- if (TREE_CODE (arg) == CONSTRUCTOR)
- {
- arg = digest_init (type, arg, complain);
- arg = convert_for_initialization (0, type, arg, LOOKUP_IMPLICIT,
- ICR_DEFAULT_ARGUMENT, fn, parmnum,
- complain);
- }
- else
- {
- arg = convert_for_initialization (0, type, arg, LOOKUP_IMPLICIT,
- ICR_DEFAULT_ARGUMENT, fn, parmnum,
- complain);
- arg = convert_for_arg_passing (type, arg, complain);
- }
+ arg = convert_for_initialization (0, type, arg, LOOKUP_IMPLICIT,
+ ICR_DEFAULT_ARGUMENT, fn, parmnum,
+ complain);
+ arg = convert_for_arg_passing (type, arg, complain);
pop_deferring_access_checks();
pop_defarg_context ();
--- /dev/null
+// PR c++/60367
+// { dg-do run { target c++11 } }
+
+extern "C" int printf (const char *, ...);
+extern "C" void abort();
+
+void *p;
+struct foo {
+ foo() { p = this; }
+ foo (const foo &) { abort(); }
+ ~foo() { if (p != this) abort(); }
+};
+
+void do_something( foo f = {} )
+{
+ if (&f != p) abort();
+}
+
+int main()
+{
+ do_something();
+}