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
This commit is contained in:
parent
aca97ef824
commit
80e7cb2d6b
3 changed files with 30 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
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>
|
||||
|
||||
* search.c (lookup_conversion_operator): Return overloads.
|
||||
|
|
|
@ -1342,7 +1342,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
|
|||
if (bad && deleted_p)
|
||||
*deleted_p = true;
|
||||
}
|
||||
else if (sfk == sfk_constructor)
|
||||
else if (sfk == sfk_constructor || sfk == sfk_inheriting_constructor)
|
||||
{
|
||||
bool bad;
|
||||
|
||||
|
|
23
gcc/testsuite/g++.dg/cpp0x/inh-ctor29.C
Normal file
23
gcc/testsuite/g++.dg/cpp0x/inh-ctor29.C
Normal file
|
@ -0,0 +1,23 @@
|
|||
// 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;
|
||||
}
|
Loading…
Add table
Reference in a new issue