From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1288 invoked by alias); 4 Mar 2005 11:59:07 -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 1191 invoked by uid 48); 4 Mar 2005 11:58:56 -0000 Date: Fri, 04 Mar 2005 11:59:00 -0000 From: "cmarco at indra dot es" To: gcc-bugs@gcc.gnu.org Message-ID: <20050304115835.20315.cmarco@indra.es> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/20315] New: G++ Problem with two-stage name lookup X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg00505.txt.bz2 List-Id: I had a derived class template which was making use of two protected variables of it’s base class. Now using GCC 3.4.4 (which implements the two- stage dependant name lookup) I’ve read that you need to use the prefix this-> or the prefix BaseClassName to avoid getting a undeclared variable message, but it doesn´t work, at least with this version of the compiler. When you compile with the –m64 option, the first time the compiler not generate the .o file just generate a .gch file and if you repeat the operation !!?, the internal compiler error message appear. If you compile at 32 bits generate the .gch file in ever occasion you compile it but the error message not appear.? I have tried the flag –fpermissive without luck. We are compiling with 64 bits. Do you now any work around? Code: template class Base { int i; }; template class Derived : public Base { int get_i() {return Base::i;} }; Preprocessed Code: # 1 "test.h" # 1 "" # 1 "" # 1 "test.h" template class Base { int i; }; template class Derived : public Base { int get_i() {return Base::i;} }; Problem : sun1:~/test> g++ -m64 -Wno-deprecated -x c++ -c test.h cc1plus: internal compiler error: in default_pch_valid_p, at ./toplev.c:4142 Please submit a full bug report, with preprocessed source if appropriate. Bug Information: sun1:~/test> g++ -v -save-temps -m64 -Wno-deprecated -x c++ -c test.h Reading specs from /usr/local/gcc-34/bin/../lib/gcc/sparc-sun- solaris2.9/3.4.4/specs Configured with: ./configure --prefix=/usr/users/afernand/comp/gcc-bootstrap- 34 --enable-language=c --without-headers --disable-shared : (reconfigured) ./configure --prefix=/usr/users/afernand/comp/gcc-bootstrap-34 - -enable-language=c --without-headers --disable-shared : (reconfigured) ./configure --prefix=/usr/users/afernand/comp/gcc-bootstrap-34 - -enable-language=c --without-headers --disable-shared : (reconfigured) ./configure --prefix=/usr/users/afernand/comp/gcc-34 --enable- language=c,c++ Thread model: posix gcc version 3.4.4 20041222 (prerelease) /usr/local/gcc-34/bin/../libexec/gcc/sparc-sun-solaris2.9/3.4.4/cc1plus -E - quiet -v -iprefix /usr/local/gcc-34/bin/../lib/gcc/sparc-sun- solaris2.9/3.4.4/ -D__arch64__ -D__sparcv9 test.h -mptr64 -mstack-bias -mno- v8plus -mcpu=v9 -m64 -Wno-deprecated -o test.ii ignoring nonexistent directory "/usr/local/gcc-34/bin/../lib/gcc/sparc-sun- solaris2.9/3.4.4/../../../../sparc-sun-solaris2.9/include" ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/users/afernand/comp/gcc-34/lib/gcc/sparc- sun-solaris2.9/3.4.4/../../../../sparc-sun-solaris2.9/include" #include "..." search starts here: #include <...> search starts here: /usr/local/gcc-34/bin/../lib/gcc/sparc-sun- solaris2.9/3.4.4/../../../../include/c++/3.4.4 /usr/local/gcc-34/bin/../lib/gcc/sparc-sun- solaris2.9/3.4.4/../../../../include/c++/3.4.4/sparc-sun-solaris2.9 /usr/local/gcc-34/bin/../lib/gcc/sparc-sun- solaris2.9/3.4.4/../../../../include/c++/3.4.4/backward /usr/local/gcc-34/bin/../lib/gcc/sparc-sun-solaris2.9/3.4.4/include /usr/users/afernand/comp/gcc-34/lib/gcc/sparc-sun- solaris2.9/3.4.4/../../../../include/c++/3.4.4 /usr/users/afernand/comp/gcc-34/lib/gcc/sparc-sun- solaris2.9/3.4.4/../../../../include/c++/3.4.4/sparc-sun-solaris2.9 /usr/users/afernand/comp/gcc-34/lib/gcc/sparc-sun- solaris2.9/3.4.4/../../../../include/c++/3.4.4/backward /usr/users/afernand/comp/gcc-34/include /usr/users/afernand/comp/gcc-34/lib/gcc/sparc-sun-solaris2.9/3.4.4/include /usr/include End of search list. /usr/local/gcc-34/bin/../libexec/gcc/sparc-sun-solaris2.9/3.4.4/cc1plus - fpreprocessed test.ii -mptr64 -mstack-bias -mno-v8plus -mcpu=v9 -quiet - dumpbase test.h -m64 -auxbase test -Wno-deprecated -version -o test.s --output- pch=test.h.gch GNU C++ version 3.4.4 20041222 (prerelease) (sparc-sun-solaris2.9) compiled by GNU C version 3.4.4 20041222 (prerelease). GGC heuristics: --param ggc-min-expand=65 --param ggc-min-heapsize=65536 Waiting to hear from you soon. Best Regards. -- Summary: G++ Problem with two-stage name lookup Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: cmarco at indra dot es CC: cmarco at indra dot es,gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20315