PR c++/78369 - {} as default argument
* call.c (build_special_member_call): Handle CONSTRUCTOR. From-SVN: r242562
This commit is contained in:
parent
d168b3daa6
commit
07a67f7b09
3 changed files with 16 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
|||
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))))
|
||||
{
|
||||
|
|
11
gcc/testsuite/g++.dg/overload/defarg11.C
Normal file
11
gcc/testsuite/g++.dg/overload/defarg11.C
Normal file
|
@ -0,0 +1,11 @@
|
|||
// PR c++/78369
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
struct A { };
|
||||
inline void f(struct A a = {}) {}
|
||||
|
||||
int main()
|
||||
{
|
||||
f();
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue