public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56323] New: [C++11] cannot compile inherited constructor for typedef'ed base class
@ 2013-02-14 14:35 t-gcc-bugzilla at snowelm dot com
  2013-02-14 14:42 ` [Bug c++/56323] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: t-gcc-bugzilla at snowelm dot com @ 2013-02-14 14:35 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56323

             Bug #: 56323
           Summary: [C++11] cannot compile inherited constructor for
                    typedef'ed base class
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: t-gcc-bugzilla@snowelm.com


Consider the following code that uses inherited constructor from a typedef'ed
type:

------------------------
struct A {
        A(int i);
};

typedef A B;

struct C : B {
        using B::B; // compile error by gcc
};

struct D : B {
        using B::A; // this is compiled as inherited constructor
};

C c(0);
D d(0);
------------------------

I believe that C should be valid, while D should be reported as invalid. 
However I cannot find anything about this problem in the C++11 standard...

In template programming, using inherited constructor is sometimes virtually
impossible, as in the following example.

------------------------
struct A {
        A(int i);
};

template <class T>
struct E {
        typedef T type;
};

template <class T>
struct F : E<T>::type {
        using E<T>::type::type; // error: E<T>::type is a typedef
};

F<A> f(0);
------------------------


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-02-27 18:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-14 14:35 [Bug c++/56323] New: [C++11] cannot compile inherited constructor for typedef'ed base class t-gcc-bugzilla at snowelm dot com
2013-02-14 14:42 ` [Bug c++/56323] " redi at gcc dot gnu.org
2013-02-14 16:42 ` jason at gcc dot gnu.org
2013-02-15  1:27 ` jason at gcc dot gnu.org
2013-02-15  9:10 ` redi at gcc dot gnu.org
2013-02-15 11:17 ` paolo.carlini at oracle dot com
2013-02-27 18:14 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).