From: mrs@cygnus.com (Mike Stump)
Newsgroups: gnu.g++.bug
Subject: Re:  bugreport g++ 2.2.2
Date: 6 Nov 92 07:18:25 GMT
Article-I.D.: cygnus.9211060718.AA22973
Distribution: gnu
Organization: GNUs Not Usenet

This problem has been fixed, and should not exist in the next release
of gcc.

Note, please do not shar things up.  Try and reduce the problem down
into one file, and just include the file.

> Message-Id: <199209031051.AA13196@triton.cv.ruu.nl>
> From: Ronald van Loon <rvloon@cv.ruu.nl>
> To: bug-g++@prep.ai.mit.edu, raeburn@cygnus.com
> Date: Thu, 3 Sep 92 12:51:58 METDST

> #!/bin/sh
> # This is a shell archive (produced by shar 3.49)
> # To extract the files from this archive, save it to a file, remove
> # everything above the "!/bin/sh" line above, and type "sh file_name".
> #
> # made 09/03/1992 10:51 UTC by rvloon@triton
> # Source directory /Userspace1/rvloon/tmp/g++
> #
> # existing files will NOT be overwritten unless -c is specified
> #
> # This shar contains:
> # length  mode       name
> # ------ ---------- ------------------------------------------
> #    440 -rw-r--r-- bugreport
> #    237 -rw------- gnu_bug.cc
> #   1055 -rw-r--r-- typescript
> #
> # ============= bugreport ==============
> if test -f 'bugreport' -a X"$1" != X"-c"; then
> 	echo 'x - skipping bugreport (File already exists)'
> else
> echo 'x - extracting bugreport (Text)'
> sed 's/^X//' << 'SHAR_EOF' > 'bugreport' &&
> Dear G++-people,
> X
> Enclosed a bug found when using templates; for some reason the compiler can't
> find a match when compiling the enclosed program. Declaring the function
> inline made the error go away, but that is of course not a structural
> solution,
> X
> Regards,
> X
> Ronald van Loon (rvloon@cv.ruu.nl) 3DCV Group, Utrecht, The Netherlands.
> X
> "I believe the word you are looking for is "AAAAAAAAAARRRRRRRRRRGGGGGHHHH!"
> X    - The Penguin (Batman ][)
> SHAR_EOF
> chmod 0644 bugreport ||
> echo 'restore of bugreport failed'
> Wc_c="`wc -c < 'bugreport'`"
> test 440 -eq "$Wc_c" ||
> 	echo 'bugreport: original size 440, current size' "$Wc_c"
> fi
> # ============= gnu_bug.cc ==============
> if test -f 'gnu_bug.cc' -a X"$1" != X"-c"; then
> 	echo 'x - skipping gnu_bug.cc (File already exists)'
> else
> echo 'x - extracting gnu_bug.cc (Text)'
> sed 's/^X//' << 'SHAR_EOF' > 'gnu_bug.cc' &&
> template <class ElementType> class A
> {
> public:
> X   A(ElementType) {}
> X   ElementType get()     const ;
> };
> X
> X
> template <class ElementType> ElementType A<ElementType>::get() const
> {
> X  return ElementType(0);
> }
> X
> main()
> {
> const A<short> a(3);
> }
> SHAR_EOF
> chmod 0600 gnu_bug.cc ||
> echo 'restore of gnu_bug.cc failed'
> Wc_c="`wc -c < 'gnu_bug.cc'`"
> test 237 -eq "$Wc_c" ||
> 	echo 'gnu_bug.cc: original size 237, current size' "$Wc_c"
> fi
> # ============= typescript ==============
> if test -f 'typescript' -a X"$1" != X"-c"; then
> 	echo 'x - skipping typescript (File already exists)'
> else
> echo 'x - extracting typescript (Text)'
> sed 's/^X//' << 'SHAR_EOF' > 'typescript' &&
> Script started on Thu Sep  3 12:45:06 1992
> X]2;[rvloon@triton] ~/tmp/g++
> [rvloon@triton] ~/tmp/g++:51 \ g++ -v gnu_bug.cc
> Reading specs from /usr/local/lib/gcc-lib/hp700/2.2.2/specs
> gcc version 2.2.2
> X /usr/local/lib/gcc-lib/hp700/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ -D__unix__ -D___HPUX_SOURCE__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -D___HPUX_SOURCE gnu_bug.cc /usr/tmp/cca12992.i
> GNU CPP version 2.2.2 (hp9000s800)
> X /usr/local/lib/gcc-lib/hp700/2.2.2/cc1plus /usr/tmp/cca12992.i -quiet -dumpbase gnu_bug.cc -version -o /usr/tmp/cca12992.s
> GNU C++ version 2.2.2 (hp9000s800) compiled by GNU C version 2.2.1.
> gnu_bug.cc: In function `int  main ()':
> gnu_bug.cc:6: template for method `get' doesn't match any in class `A<short int>'
> X
> [rvloon@triton] ~/tmp/g++:52 exit
> exit
> X
> script done on Thu Sep  3 12:45:25 1992
> SHAR_EOF
> chmod 0644 typescript ||
> echo 'restore of typescript failed'
> Wc_c="`wc -c < 'typescript'`"
> test 1055 -eq "$Wc_c" ||
> 	echo 'typescript: original size 1055, current size' "$Wc_c"
> fi
> exit 0
Newsgroups: gnu.g++.bug