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]

g++ 2.95.2 internal compiler error, template related.



Hi, I am reporting a bug I found, causing the C++ compiler to report internal
compiler error. Here is a short program that causes the bug:
############################
/*
  Member templates cause internal compiler error when passed as template parameters
  to a template. Top-level templates work fine.
 */

template <template <int n> class Foo> struct Bar 
{

};

namespace ExtScope {
  template <int n> struct Member { };
}

struct ExtClass {
  template <int n> struct Member { };
};

main()
{
  Bar< ExtScope::Member > x;    // works fine
  Bar< ExtClass::Member > y;    // internal compiler error !!!
}

################################
and here is the compiler output:

/opt/devel/bin/g++ -v -c tmplbug.cc
Reading specs from /opt/devel/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /opt/devel/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ tmplbug.cc /tmp/ccL5HCQ2.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /opt/devel/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../include/g++-3
 /usr/local/include
 /opt/devel/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../i586-pc-linux-gnu/include
 /opt/devel/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/lib/interviews/include/IV-2_6
 /usr/lib/interviews/include
End of omitted list.
 /opt/devel/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cc1plus /tmp/ccL5HCQ2.ii -quiet -dumpbase tmplbug.cc -version -o /tmp/ccTCqTY4.s
GNU C++ version 2.95.2 19991024 (release) (i586-pc-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
tmplbug.cc: In function `int main()':
tmplbug.cc:21: Internal compiler error 980422.
tmplbug.cc:21: Please submit a full bug report.
tmplbug.cc:21: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.

Compilation exited abnormally with code 1 at Fri Mar  3 09:52:03

######################################

Thanks to all gcc developers!!

Vasilis




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