From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26233 invoked by alias); 21 Feb 2007 12:28:04 -0000 Received: (qmail 26157 invoked by uid 48); 21 Feb 2007 12:27:55 -0000 Date: Wed, 21 Feb 2007 12:28:00 -0000 Message-ID: <20070221122755.26156.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/30909] public member of template class not visible in derived template class In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sl at datamyway dot de" 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: 2007-02/txt/msg02447.txt.bz2 ------- Comment #1 from sl at datamyway dot de 2007-02-21 12:27 ------- Sorry for my cut&paste, the files really are: A.h: //const int NUM_BYTES = 5; template class A { public: int mBytes[NUM_BYTES]; }; ---- B.h: #include "A.h" template class B : public A { public: int blee() { mBytes[0]++; return mBytes[0]; }; }; ---- x.cpp: #include using namespace std; #include "B.h" int main (int argc, char* argv[]) { B<4> *b = new B<4>; b->blee(); cout << b->blee() << endl; } --- makefile: .SUFFIXES: all: x % :: %.cpp rm -f $@ g++ -ansi -pedantic -Wall -o $@ $^ % :: %.c rm -f $@ g++ -o $@ $^ -lgmp -lpq %.o :: %.cpp %.hpp rm -f $@ g++ -c $< -g %.o :: %.c rm -f $@ g++ -c $< -g --- -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30909