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]

GNU C++ version 2.96 19991025 (experimental) (sparc-sun-solaris2.7): Internal compiler error.



Putting an extern inside a templated class causes an internal compiler 
error.

OS: SunOS carlsbad 5.7 Generic sun4u sparc SUNW,Ultra-5_10
Releases: 2.96 19991013, and 19991025


g++ -DBUG -c -g -fPIC -D__sparc__ flat.cc -o bflat.o
flat.cc: In method `void Uint<W>::barf () [with unsigned int W = 1]':
flat.cc:15:   instantiated from here
flat.cc:10: Internal compiler error.
flat.cc:10: Please submit a full bug report.
flat.cc:10: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
make: *** [bflat.o] Error 1


flat.cc:
template<const unsigned int W>
class Uint {
  public:
  void barf();
};

template<const unsigned int W>
void Uint<W>::barf()
{
  extern int Cynprofile;
};

main( int argc, char *argv[] ) {
  Uint<1> port;
  port.barf();
};


Robert A. Clark  (408) 588-4000  x22  robert@cynapps.com
CynApps, 2520 Mission College Blvd., Suite 101
Santa Clara, CA 95054
www.cynapps.com


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