From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30826 invoked by alias); 29 Apr 2003 00:19:14 -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 30807 invoked by uid 48); 29 Apr 2003 00:19:14 -0000 Date: Tue, 29 Apr 2003 00:19:00 -0000 Message-ID: <20030429001914.30806.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, giovannibajo@libero.it, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, giovannibajo@libero.it, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/10530: [3.4 regression] Cannot access non-dependent type within nested template X-SW-Source: 2003-04/txt/msg01307.txt.bz2 List-Id: Synopsis: [3.4 regression] Cannot access non-dependent type within nested template State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Tue Apr 29 00:19:14 2003 State-Changed-Why: Correct. Even smaller: -------------------------- template struct Foo { struct Inner { typedef int type; }; }; template struct Bar { typedef typename Foo::Inner::type type; }; ------------------------------ This won't compile with present mainline: g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc:9: error: no type named `type' in `struct Foo::Inner' x.cc:9: error: ISO C++ forbids declaration of `type' with no type If now someone (probably rightfully) argues that the "typename" is not necessary here -- this is what we get in that case: g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc:9: error: type `Foo::Inner' is not derived from type `Bar' x.cc:9: error: ISO C++ forbids declaration of `type' with no type x.cc:9: error: expected `;' Ups, that's even worse... For the record: icc7 compiles it with and without the typename stuff. So does gcc3.3, so this is indeed a regression. W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10530