This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug report for C++
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: Bug report for C++
- From: Ronan Amicel <Ronan dot Amicel at ens dot insa-rennes dot fr>
- Date: Wed, 12 May 1999 15:30:09 +0200
- Organization: IRISA, Campus de Beaulieu, 35042 Rennes Cedex, FRANCE
- Reply-To: Ronan Amicel <ramicel at irisa dot fr>
Command-line:
eg++ -v --save-temps bug.cpp
Output:
Reading specs from
/usr/local/egcs-1.1.2-n/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
/usr/local/egcs-1.1.2-n/lib/gcc-lib/sparc-sun-solaris2.6/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) bug.cpp bug.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/egcs-1.1.2-n/include/g++
/usr/local/include
/usr/local/egcs-1.1.2-n/sparc-sun-solaris2.6/include
/usr/local/egcs-1.1.2-n/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.66/include
/usr/include
End of search list.
/usr/local/egcs-1.1.2-n/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.66/cc1plus
bug.ii -quiet -dumpbase bug.cc -version -o bug.s
GNU C++ version egcs-2.91.66 19990314 (egcs-1.1.2 release)
(sparc-sun-solaris2.6) compiled by GNU C version egcs-2.91.66 19990314
(egcs-1.1.2 release).
bug.cpp: In function `int main()':
bug.cpp:62: Internal compiler error 373.
bug.cpp:62: Please submit a full bug report to
`egcs-bugs@egcs.cygnus.com'.
bug.cpp:62: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for
details.
Original and preprocessed source files are attached...
# 1 "bug.cpp"
template <unsigned W>
class Val
{
};
template <unsigned W>
class Expr
{
};
template <unsigned W>
class Operation : public Expr<W>
{
public:
typedef Val<W> (*func_t)();
Operation( func_t o ) {
}
protected:
func_t op;
};
template<unsigned W>
Val<W> Function1()
{
}
namespace Op
{
template<unsigned W>
Val<W> Function2()
{
}
};
int main()
{
Expr<32> *e1 = new Operation<32>( Function1<32> );
Expr<32> *e2 = new Operation<32>( Op::Function2<32> );
return 0;
}
//
// egcs-2.91.6
// Internal compiler error 373
//
//-------------------------
template <unsigned W>
class Val
{
// details ommited
};
template <unsigned W>
class Expr
{
// details ommited
};
//-------------------------
template <unsigned W>
class Operation : public Expr<W>
{
public:
typedef Val<W> (*func_t)();
Operation( func_t o ) {
}
protected:
func_t op;
};
//-------------------------
// first function family (ok)
template<unsigned W>
Val<W> Function1()
{
}
// second function family
namespace Op
{
template<unsigned W>
Val<W> Function2()
{
}
};
//-------------------------
int main()
{
// This one is ok
Expr<32> *e1 = new Operation<32>( Function1<32> );
// That one generates compiler error
Expr<32> *e2 = new Operation<32>( Op::Function2<32> );
return 0;
}