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]

Template bug


Hullo,

 I thought you might like to know about this bug in the template handling
code thats been giving me some trouble. In case its of any use, you might as
well know that swapping the order in which the functions test1 and test2 are
declared fixes the problem. As well as being in the latest snapshot I've
got, this bug is also in gcc release 2.95.1.

----
Command line args. used to compile it:

/usr/local/gcc/bin/g++ -v -c main.cc -o main.o
Reading specs from /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 19991004 (experimental)

/usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.96/cpp -lang-c++ -v -D__GNUC_
_=2 -D__GNUG__=2 -D__GNUC_MINOR__=96 -D__cplusplus -D__ELF__ -Dunix -D__i386
__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -A
system(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D_
_i386__ -D__tune_pentiumpro__ main.cc main.ii
GNU CPP version 2.96 19991004 (experimental) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.96/../../../../include/g++-3
 /usr/local/gcc/include

/usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.96/../../../../i686-pc-linux-
gnu/include
 /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.96/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.96/cc1plus
main.ii -quiet -dumpbase main.cc -version -o main.s
GNU C++ version 2.96 19991004 (experimental) (i686-pc-linux-gnu) compiled by
GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
main.cc:11: warning: all member functions in class `Test' are private
main.cc:11: Tree check: expected field_decl, have type_decl
main.cc:11: Internal compiler error in `finish_struct_1', at
../egcs-19991004/gcc/cp/class.c:3864
Please submit a full bug report.

----
Machine details: Celeron with Redhat Linux 6.0

----
gcc configure
commands: --prefix=/usr/local/gcc --enable-languages=c++ --with-gnu-as --ena
ble-checking

----
File main.ii: Nice simple test case to trigger the error:

# 1 "main.cc"
class Test {

  void test1(void) {
    test2(2.0);
  }

  template <class TestT>
  void test2(TestT v) {
  }

};

int main() {
  return 0;
}


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