From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7312 invoked by alias); 14 Feb 2013 14:35:36 -0000 Received: (qmail 5373 invoked by uid 48); 14 Feb 2013 14:33:56 -0000 From: "t-gcc-bugzilla at snowelm dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56323] New: [C++11] cannot compile inherited constructor for typedef'ed base class Date: Thu, 14 Feb 2013 14:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: t-gcc-bugzilla at snowelm dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg01433.txt.bz2 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 struct E { typedef T type; }; template struct F : E::type { using E::type::type; // error: E::type is a typedef }; F f(0); ------------------------