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]

internal compiler error


I am getting an internal error from GCC 2.95.2 when compiling the C++
program tmp.C listed below.  I am using the Mingw32 version of GCC
(from http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) on
Windows NT 4.0 with the MKS shell.

=tmp.C==============================================================
template <typename T, int I>
void f( T*, int (*)[I], int (*)[I+4] )
{
}

int main()
{
   f( (int*)0, (int(*)[1])0, (int (*)[5])0 );

   return 0;
}
=Shell output=======================================================
$ g++ -v
Reading specs from c:\gcc-2.95\bin\..\lib\gcc-lib\i386-mingw32msvc\2.95.2\specs
gcc version 2.95.2 19991024 (release)
$ g++ -c tmp.C
tmp.C: In function `int main()':
tmp.C:3: Internal compiler error.
tmp.C:3: Please submit a full bug report.
tmp.C:3: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
====================================================================

Based on paragraph 14 in section 14.8.2.4 of the ISO C++ standard, I
believe the template specialization:

   void f<int, 4>( int*, int (*)[1], int (*)[5] )

should be deduced for the call to f() in main().

--
Jack Rouse
sasjjr@unx.sas.com

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