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]

Bug Report: Internal compiler error 980519



Hello...

This is my first attempt at a bug report, so I hope I have everything
you need.  I included below the results of "g++ -v --save-temps..." as
recommended on the bug reporting website.

Attached is the source file (templatebug.cxx), and the pre-processed
output (templatebug.ii).

A brief description of the problem: when there are two templated
methods inside the same namespace and one calls the other, an internal
compiler error will be reported if the caller specifies the namespace
of the callee.  No error will be reported if the namespace is left
off.  There is a comment in the source file to that effect.

If you have problems reproducing the error, or have questions, please
feel free to contact me at tweedy@lusars.net.

Thank you!
laura

BUILD@quadsun: ~/tmp 109> g++ -v --save-temps -c templatebug.cxx
Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.66/cpp
 -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
 -D__GNUC_MINOR__=91 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4
 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc
 -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS
 -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) templatebug.cxx
 templatebug.ii
GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/sparc-sun-solaris2.5.1/include
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.66/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.66/cc1plus
 templatebug.ii -quiet -dumpbase templatebug.cc -version -o
 templatebug.s
GNU C++ version egcs-2.91.66 19990314 (egcs-1.1.2 release)
(sparc-sun-solaris2.5.1) compiled by GNU C version egcs-2.91.66
19990314 (egcs-1.1.2 release).
templatebug.cxx: In function `bool Baz<int>()':
templatebug.cxx:20:   instantiated from here
templatebug.cxx:13: Internal compiler error 980519.
templatebug.cxx:13: Please submit a full bug report to
`egcs-bugs@egcs.cygnus.com'.
templatebug.cxx:13: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.
BUILD@quadsun: ~/tmp 110> 



#include <stdio.h>
#include <limits.h>

namespace Foo {
    template<class T>
    bool Bar() { 
	fprintf(stderr, "Foo::Bar exec\n"); 
	return true; 
    };
    template<class T>
    bool Baz() { 
	fprintf(stderr, "Foo::Baz exec\n"); 
	return Foo::Bar<int>(); 
	// If this line is replaced with just Bar<int>(); everything
	// will work just fine.
    };
}; //namespace Foo

int main() {
    Foo::Baz<int>();

    return 0;
}

templatebug.ii.gz


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