Commit 07a67f7b by Jason Merrill Committed by Jason Merrill

PR c++/78369 - {} as default argument

	* call.c (build_special_member_call): Handle CONSTRUCTOR.

From-SVN: r242562
parent d168b3da
2016-11-17 Jason Merrill <jason@redhat.com>
PR c++/78369 - {} as default argument
* call.c (build_special_member_call): Handle CONSTRUCTOR.
PR c++/68377
* parser.c (cp_parser_fold_expression): Check TREE_NO_WARNING.
......
......@@ -8317,7 +8317,8 @@ build_special_member_call (tree instance, tree name, vec<tree, va_gc> **args,
if (!reference_related_p (class_type, TREE_TYPE (arg)))
arg = perform_implicit_conversion_flags (class_type, arg,
tf_warning, flags);
if (TREE_CODE (arg) == TARGET_EXPR
if ((TREE_CODE (arg) == TARGET_EXPR
|| TREE_CODE (arg) == CONSTRUCTOR)
&& (same_type_ignoring_top_level_qualifiers_p
(class_type, TREE_TYPE (arg))))
{
......
// PR c++/78369
// { dg-do compile { target c++11 } }
struct A { };
inline void f(struct A a = {}) {}
int main()
{
f();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment