Commit f3f7cefe by Jason Merrill Committed by Jason Merrill

PR libstdc++/85843 - warning in logic_error copy constructor.

	* class.c (type_has_user_nondefault_constructor): Check for a
	user-provided ctor, not user-declared.

From-SVN: r260432
parent 777083bb
2018-05-20 Jason Merrill <jason@redhat.com>
PR libstdc++/85843 - warning in logic_error copy constructor.
* class.c (type_has_user_nondefault_constructor): Check for a
user-provided ctor, not user-declared.
2018-05-19 Jason Merrill <jason@redhat.com> 2018-05-19 Jason Merrill <jason@redhat.com>
* pt.c (tsubst_pack_expansion): Sorry rather than abort * pt.c (tsubst_pack_expansion): Sorry rather than abort
......
...@@ -4884,7 +4884,7 @@ default_ctor_p (tree fn) ...@@ -4884,7 +4884,7 @@ default_ctor_p (tree fn)
&& sufficient_parms_p (FUNCTION_FIRST_USER_PARMTYPE (fn))); && sufficient_parms_p (FUNCTION_FIRST_USER_PARMTYPE (fn)));
} }
/* Returns true iff class T has a user-defined constructor that can be called /* Returns true iff class T has a user-provided constructor that can be called
with more than zero arguments. */ with more than zero arguments. */
bool bool
...@@ -4896,7 +4896,7 @@ type_has_user_nondefault_constructor (tree t) ...@@ -4896,7 +4896,7 @@ type_has_user_nondefault_constructor (tree t)
for (ovl_iterator iter (CLASSTYPE_CONSTRUCTORS (t)); iter; ++iter) for (ovl_iterator iter (CLASSTYPE_CONSTRUCTORS (t)); iter; ++iter)
{ {
tree fn = *iter; tree fn = *iter;
if (!DECL_ARTIFICIAL (fn) if (user_provided_p (fn)
&& (TREE_CODE (fn) == TEMPLATE_DECL && (TREE_CODE (fn) == TEMPLATE_DECL
|| (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn)) || (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
!= NULL_TREE))) != NULL_TREE)))
......
// PR libstdc++/85843
// { dg-do compile { target c++11 } }
// { dg-additional-options -Wextra }
struct A
{
A();
A(const A&) = default;
};
struct B : A
{
B(): A() { }
B(const B&) { }
};
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