Commit 80e7cb2d by Leonid Koppel Committed by Jason Merrill

PR c++/67054 - Inherited ctor with non-default-constructible members

        PR c++/67054 - Inherited ctor with non-default-constructible members
        * method.c (walk_field_subobs) Consider member initializers (NSDMIs)
	when deducing an inheriting constructor.

From-SVN: r250583
parent aca97ef8
2017-07-26 Leonid Koppel <lkoppel@uwaterloo.ca>
PR c++/67054 - Inherited ctor with non-default-constructible members
* method.c (walk_field_subobs) Consider member initializers (NSDMIs)
when deducing an inheriting constructor.
2017-07-21 Nathan Sidwell <nathan@acm.org> 2017-07-21 Nathan Sidwell <nathan@acm.org>
* search.c (lookup_conversion_operator): Return overloads. * search.c (lookup_conversion_operator): Return overloads.
......
...@@ -1342,7 +1342,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk, ...@@ -1342,7 +1342,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
if (bad && deleted_p) if (bad && deleted_p)
*deleted_p = true; *deleted_p = true;
} }
else if (sfk == sfk_constructor) else if (sfk == sfk_constructor || sfk == sfk_inheriting_constructor)
{ {
bool bad; bool bad;
......
// PR c++/67054
// { dg-do compile { target c++11 } }
struct A
{
A(int) {}
};
struct C
{
C(int) {}
};
struct B : A
{
using A::A;
C c = 42;
};
int main()
{
B b = 24;
}
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