From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58189 invoked by alias); 2 Jun 2015 03:35:12 -0000 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 Received: (qmail 58160 invoked by uid 48); 2 Jun 2015 03:35:09 -0000 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66350] typename should be forbidden in inhering constructors Date: Tue, 02 Jun 2015 03:35:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-06/txt/msg00104.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66350 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org --- Comment #1 from Martin Sebor --- Here's a reduced test case compiled with -Wall in C++ 98 mode: $ cat t.cpp && ~/bin/gcc-5.1.0/bin/g++ -Wall -std=c++98 -c t.cpp template struct A { A (T) { } }; template struct B: A { using typename A::A; }; B b (0); t.cpp:3:26: warning: inheriting constructors only available with -std=c++11 or -std=gnu++11 using typename A::A; ^ I don't think gcc is incorrect in accepting the code either in C++ 98 mode as an extension, or in C++ 11 mode. In the latter mode, accepting it is in keeping with the resolution of DR 147. Naming the constructor (Clang accepts the test case above in C++ 11 mode). That is, when 'A::A' nominates class template A the name is instead taken to name the ctor of A.