From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31252 invoked by alias); 19 Nov 2002 15:13:13 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 31233 invoked by uid 61); 19 Nov 2002 15:13:11 -0000 Date: Mon, 25 Nov 2002 15:36:00 -0000 Message-ID: <20021119151311.31232.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, struppi@acm.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, struppi@acm.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/8633: [3.3 regression] typedefs as base classes X-SW-Source: 2002-11/txt/msg00956.txt.bz2 List-Id: Old Synopsis: g++ doesn't resolve typedefs of templated classes properly New Synopsis: [3.3 regression] typedefs as base classes State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Tue Nov 19 07:13:10 2002 State-Changed-Why: Confirmed. This is a reduced testcase: ----------------------- namespace NS { class X {}; typedef X Y; } struct Base : virtual public NS::Y { Base() : NS::Y() {} }; ------------------------- The messages are tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ x.cc x.cc: In constructor `Base::Base()': x.cc:7: error: type `NS::Y' is not a direct or virtual base of `Base' I am unsure whether the code is illegal: 10.1 states that the names of base classes shall be class names, so a typedef may not qualify. However, gcc should then tell us so at the point of the base class list, not in the constructor. What is also suspicious is that the error goes away if one makes the base class non-virtual or moves X and Y into the global namespace. Something's wrong here. I can compile the testcase above with 2.95 and 3.2.1pre, so assuming it is legal, it is a regression. I thus raise its priority. If it is not legal, someone will give an explanation of this inconsistent behavior. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8633