[Bug c++/81527] Missing inherited constructor by "using-declarations"

2017-07-24 Thread tuwwcn at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81527

--- Comment #1 from Wei-Wei Tu  ---
Some additional information:

The above code is REJECTED by GCC 6.2.0 too.

But the below code is PASSED by GCC 6.1.0, 6.3.0, 6.4.0, 7.1.0. The only
difference is explicitly casting p's type to its own type.

/
#include 

struct A : public std::pair< int, int> {
using std::pair::pair;
};

int main() {
std::pair p{1, 2}; 
A a(std::pair(p));
}
///

[Bug c++/81527] Missing inherited constructor by "using-declarations"

2017-07-24 Thread tuwwcn at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81527

--- Comment #2 from Wei-Wei Tu  ---
> The above code is REJECTED by GCC 6.2.0 too.
==> Sorry for the mistake, The above code is ACCEPTED by GCC 6.2.0 too.

(In reply to Wei-Wei Tu from comment #1)
> Some additional information:
> 
> The above code is REJECTED by GCC 6.2.0 too.
> 
> But the below code is PASSED by GCC 6.1.0, 6.3.0, 6.4.0, 7.1.0. The only
> difference is explicitly casting p's type to its own type.
> 
> /
> #include 
> 
> struct A : public std::pair< int, int> {
> using std::pair::pair;
> };
> 
> int main() {
> std::pair p{1, 2}; 
> A a(std::pair(p));
> }
> ///

[Bug c++/81527] Missing inherited constructor by "using-declarations"

2017-07-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81527

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Jonathan Wakely  ---
I don't think the code is valid, copy/move constructors are not inherited. See
PR 69853 for a similar bug report.

*** This bug has been marked as a duplicate of bug 69853 ***

[Bug c++/81527] Missing inherited constructor by "using-declarations"

2017-07-25 Thread tuwwcn at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81527

--- Comment #4 from Wei-Wei Tu  ---
(In reply to Jonathan Wakely from comment #3)
> I don't think the code is valid, copy/move constructors are not inherited.
> See PR 69853 for a similar bug report.
> 
> *** This bug has been marked as a duplicate of bug 69853 ***

Yes, you are right. I've made a mistake about "using". Thank you for checking
this report.