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 for C++



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;
}

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