From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21723 invoked by alias); 21 Jun 2004 16:50:58 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21688 invoked from network); 21 Jun 2004 16:50:57 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 21 Jun 2004 16:50:57 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i5LGove1001249; Mon, 21 Jun 2004 12:50:57 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5LGos022548; Mon, 21 Jun 2004 12:50:54 -0400 Received: from livre.redhat.lsd.ic.unicamp.br (vpn64-27.boston.redhat.com [172.16.66.27]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i5LGolox020207; Mon, 21 Jun 2004 12:50:53 -0400 Received: from livre.redhat.lsd.ic.unicamp.br (livre.redhat.lsd.ic.unicamp.br [127.0.0.1]) by livre.redhat.lsd.ic.unicamp.br (8.12.11/8.12.11) with ESMTP id i5LGok11000846; Mon, 21 Jun 2004 13:50:46 -0300 Received: (from aoliva@localhost) by livre.redhat.lsd.ic.unicamp.br (8.12.11/8.12.11/Submit) id i5LGofmj000841; Mon, 21 Jun 2004 13:50:41 -0300 To: "Frank Chow" Cc: "gcc-bugs@gcc.gnu.org" Subject: Re: GCC 3.4.0: a derived class can't access the data member of a template base class References: From: Alexandre Oliva Organization: Red Hat Global Engineering Services Compiler Team Date: Mon, 21 Jun 2004 16:50:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-06/txt/msg02638.txt.bz2 List-Id: > template struct D : public T { D() { nSize = sizeof(T); > } }; nSize is not a template-dependent name, so it's bound at parse time, rather than at template instantiation time. You must use this->nSize or T::nSize to make it template-dependent. > By the way, gcc (GCC) 3.3.1 (cygwin version) can compile this code > successfully That was a bug, fixed in 3.4. > so do Visual C++ .Net (cl v 13.10.3077). You'll have to report this bug to someone else, then :-) -- Alexandre Oliva http://www.ic.unicamp.br/~oliva/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}