This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/20315] New: G++ Problem with two-stage name lookup


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<T> 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 <typename T> class Base {
  int i;
};
template <typename T> class Derived : public Base<T> {
   int get_i() {return Base<T>::i;}
};


Preprocessed Code:
# 1 "test.h"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "test.h"
template <typename T> class Base {
  int i;
};
template <typename T> class Derived : public Base<T> {
   int get_i() {return Base<T>::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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]