Debian Bug report logs - #21122
[Fixed in upstream 2.92.21] g++: eg++ doesn't compile programs accepted by g++

Package: g++272; Maintainer for g++272 is (unknown);

Reported by: Herbert Xu <herbert@gondor.apana.org.au>

Date: Tue, 14 Apr 1998 12:33:01 UTC

Severity: fixed

Done: Matthias Klose <doko@cs.tu-berlin.de>

Bug is archived. No further changes may be made.

Forwarded to egcs-bugs@cygnus.com

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Galen Hazelwood <galenh@micron.net>:
Bug#21122; Package g++. (full text, mbox, link).


Acknowledgement sent to Herbert Xu <herbert@gondor.apana.org.au>:
New bug report received and forwarded. Copy sent to Galen Hazelwood <galenh@micron.net>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Herbert Xu <herbert@gondor.apana.org.au>
To: submit@bugs.debian.org
Subject: g++: eg++ doesn't compile programs accepted by g++
Date: Tue, 14 Apr 1998 22:28:46 +1000
Package: g++
Version: 2.90.27-0.5
Severity: important

This means that working packages are broken by egcs, hence the important
severity.

Here's the program in question (a scaled down version, comes from prcs):
(If this turns out to be against the ANSI standard, please tell me, thanks)

template<class T>
class A {
public:
	operator const T*() const;
	const T* cast() const;
};

template<class T>
A<T>::operator const T*() const {
	return 0;
}

template<class T>
const T* A<T>::cast() const {
	return operator const T*();
}

template class A<char>;


Information forwarded to debian-bugs-dist@lists.debian.org, Galen Hazelwood <galenh@micron.net>:
Bug#21122; Package g++. (full text, mbox, link).


Acknowledgement sent to jdassen@wi.leidenuniv.nl:
Extra info received and forwarded to list. Copy sent to Galen Hazelwood <galenh@micron.net>. (full text, mbox, link).


Message #10 received at 21122@bugs.debian.org (full text, mbox, reply):

From: jdassen@wi.leidenuniv.nl
To: 21122@bugs.debian.org
Subject: Re: Bug#21122: g++: eg++ doesn't compile programs accepted by g++
Date: Tue, 14 Apr 1998 15:52:07 +0200
On Tue, Apr 14, 1998 at 10:28:46PM +1000, Herbert Xu wrote:
> Here's the program in question (a scaled down version, comes from prcs):
> (If this turns out to be against the ANSI standard, please tell me, thanks)
> 
> template<class T>
> class A {
> public:
> 	operator const T*() const;
> 	const T* cast() const;
> };
> 
> template<class T>
> A<T>::operator const T*() const {
> 	return 0;
> }
> 
> template<class T>
> const T* A<T>::cast() const {
> 	return operator const T*();
> }
> 
> template class A<char>;

Are you sure about that last line? If it's the intend to instantiate
template A with char, then it should be something like
	   class A<char> foo;
	^  ------------- ---
	|       ^         ^
	|       |         |
	|     type       variable
	|
	no template here
which compiles.

Ray
-- 
Obsig: developing a new sig


Information forwarded to debian-bugs-dist@lists.debian.org, Galen Hazelwood <galenh@micron.net>:
Bug#21122; Package g++. (full text, mbox, link).


Acknowledgement sent to Herbert Xu <herbert@gondor.apana.org.au>:
Extra info received and forwarded to list. Copy sent to Galen Hazelwood <galenh@micron.net>. (full text, mbox, link).


Message #15 received at 21122@bugs.debian.org (full text, mbox, reply):

From: Herbert Xu <herbert@gondor.apana.org.au>
To: 21122@bugs.debian.org
Subject: Re: Bug#21122: g++: eg++ doesn't compile programs accepted by g++
Date: Wed, 22 Apr 1998 08:57:06 +1000 (EST)
jdassen@wi.leidenuniv.nl wrote:
> >
> > template class A<char>;
> 
> Are you sure about that last line? If it's the intend to instantiate
> template A with char, then it should be something like

Yep, it's called explicit template instantiation.

PS Please pleasea cc me when you reply or otherwise I'd probably miss it as I
did here.  Thanks.

-- 
Debian GNU/Linux 1.3 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Information forwarded to debian-bugs-dist@lists.debian.org, Galen Hazelwood <galenh@micron.net>:
Bug#21122; Package g++. (full text, mbox, link).


Acknowledgement sent to jdassen@wi.leidenuniv.nl:
Extra info received and forwarded to list. Copy sent to Galen Hazelwood <galenh@micron.net>. (full text, mbox, link).


Message #20 received at 21122@bugs.debian.org (full text, mbox, reply):

From: jdassen@wi.leidenuniv.nl
To: egcs-bugs@cygnus.com
Cc: 21122@bugs.debian.org
Subject: [herbert@gondor.apana.org.au: Bug#21122: g++: eg++ doesn't compile programs accepted by g++]
Date: Wed, 22 Apr 1998 09:19:47 +0200
[Message part 1 (text/plain, inline)]
The following was reported as a bug through the Debian bugtracking system
(http://www.debian.org/). Please Cc: 21122@bugs.debian.org on on-topic
replies.

Background: Debian's "g++" package is egcs's g++ (1.0.2 + patch from
http://www.cygnus.com/ml/egcs/1998-Apr/0614.html).

The example code is accepted by gcc 2.7.2.3's g++.

Greetings,
Ray
-- 
Obsig: developing a new sig
[Message part 2 (message/rfc822, inline)]
From: Herbert Xu <herbert@gondor.apana.org.au>
To: submit@bugs.debian.org
Subject: Bug#21122: g++: eg++ doesn't compile programs accepted by g++
Date: Tue, 14 Apr 1998 22:28:46 +1000
Package: g++
Version: 2.90.27-0.5
Severity: important

This means that working packages are broken by egcs, hence the important
severity.

Here's the program in question (a scaled down version, comes from prcs):
(If this turns out to be against the ANSI standard, please tell me, thanks)

template<class T>
class A {
public:
	operator const T*() const;
	const T* cast() const;
};

template<class T>
A<T>::operator const T*() const {
	return 0;
}

template<class T>
const T* A<T>::cast() const {
	return operator const T*();
}

template class A<char>;


--
To UNSUBSCRIBE, email to debian-bugs-dist-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
[Message part 3 (message/rfc822, inline)]
From: jdassen@wi.leidenuniv.nl
To: 21122@bugs.debian.org
Subject: Bug#21122: g++: eg++ doesn't compile programs accepted by g++
Date: Tue, 14 Apr 1998 15:52:07 +0200
On Tue, Apr 14, 1998 at 10:28:46PM +1000, Herbert Xu wrote:
> Here's the program in question (a scaled down version, comes from prcs):
> (If this turns out to be against the ANSI standard, please tell me, thanks)
> 
> template<class T>
> class A {
> public:
> 	operator const T*() const;
> 	const T* cast() const;
> };
> 
> template<class T>
> A<T>::operator const T*() const {
> 	return 0;
> }
> 
> template<class T>
> const T* A<T>::cast() const {
> 	return operator const T*();
> }
> 
> template class A<char>;

Are you sure about that last line? If it's the intend to instantiate
template A with char, then it should be something like
	   class A<char> foo;
	^  ------------- ---
	|       ^         ^
	|       |         |
	|     type       variable
	|
	no template here
which compiles.

Ray
-- 
Obsig: developing a new sig


--
To UNSUBSCRIBE, email to debian-bugs-dist-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
[Message part 4 (message/rfc822, inline)]
From: Herbert Xu <herbert@gondor.apana.org.au>
To: 21122@bugs.debian.org
Subject: Bug#21122: g++: eg++ doesn't compile programs accepted by g++
Date: Wed, 22 Apr 1998 08:57:06 +1000 (EST)
jdassen@wi.leidenuniv.nl wrote:
> >
> > template class A<char>;
> 
> Are you sure about that last line? If it's the intend to instantiate
> template A with char, then it should be something like

Yep, it's called explicit template instantiation.

PS Please pleasea cc me when you reply or otherwise I'd probably miss it as I
did here.  Thanks.

-- 
Debian GNU/Linux 1.3 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


--
To UNSUBSCRIBE, email to debian-bugs-dist-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Noted your statement that bug has been forwarded to egcs-bugs@cygnus.com. Request was from jdassen@wi.leidenuniv.nl to control@bugs.debian.org. (full text, mbox, link).


Severity set to `normal'. Request was from Brian White <bcwhite@verisim.com> to control@bugs.debian.org. (full text, mbox, link).


Forwarded-to-address changed from egcs-bugs@cygnus.com to egcs-bugs@cygnus.com. Request was from jdassen@wi.leidenuniv.nl to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Galen Hazelwood <galenh-egcs@debian.org>:
Bug#21122; Package g++. (full text, mbox, link).


Acknowledgement sent to Matthias Klose <doko@cs.tu-berlin.de>:
Extra info received and forwarded to list. Copy sent to Galen Hazelwood <galenh-egcs@debian.org>. (full text, mbox, link).


Message #31 received at 21122@bugs.debian.org (full text, mbox, reply):

From: Matthias Klose <doko@cs.tu-berlin.de>
To: 21122@bugs.debian.org, Herbert Xu <herbert@gondor.apana.org.au>
Subject: #21122 fixed in egcs-snapshot
Date: Mon, 16 Nov 1998 12:51:32 +0100 (MET)
This bug seems to be fixed in a current egcs snapshot (g++-ss-2.92.21)
please see the packages in project/experimental.



Information forwarded to debian-bugs-dist@lists.debian.org, Galen Hazelwood <galenh-egcs@debian.org>:
Bug#21122; Package g++. (full text, mbox, link).


Acknowledgement sent to Matthias Klose <doko@cs.tu-berlin.de>:
Extra info received and forwarded to list. Copy sent to Galen Hazelwood <galenh-egcs@debian.org>. (full text, mbox, link).


Message #36 received at 21122@bugs.debian.org (full text, mbox, reply):

From: Matthias Klose <doko@cs.tu-berlin.de>
To: egcs-bugs@cygnus.com
Cc: 21122@bugs.debian.org
Subject: g++: LD is not demangling
Date: Mon, 16 Nov 1998 13:47:00 +0100 (MET)
The following was reported as a bug through the Debian bugtracking system
(http://www.debian.org/Bugs/db/21/21122.html).

Received: (at submit) by bugs.debian.org; 1 Nov 1998 04:59:42 +0000
Received: (qmail 25177 invoked from network); 1 Nov 1998 04:59:41 -0000
Received: from cloak.videotron.ab.ca (HELO mail.videotron.ab.ca) (206.75.216.100)
  by master.debian.org with SMTP; 1 Nov 1998 04:59:41 -0000
Received: from Wakko.ualberta.ca ([24.108.38.177]) by mail.videotron.ab.ca
          (Netscape Messaging Server 3.6)  with ESMTP id AAA6A3F;
          Sat, 31 Oct 1998 21:58:52 -0700
Received: from jgg by Wakko.ualberta.ca with local (Exim 1.92 #1)
        id 0zZpc2-0002KV-00 (Debian); Sat, 31 Oct 1998 21:59:38 -0700
From: Jason Gunthorpe <jgg@gpu.srv.ualberta.ca>
Subject: g++: LD is not demangling
To: submit@bugs.debian.org
X-Mailer: bug 3.1.5
Message-Id: <E0zZpc2-0002KV-00@Wakko.ualberta.ca>
Date: Sat, 31 Oct 1998 21:59:38 -0700

Package: g++
Version: 2.91.57-5

For some reason c++-filt and 'ld' refuse to demangle this...

Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/lib/gcc-lib/i486-linux/egcs-2.91.57/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o ../build/bin/methods/http
/usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i486-linux/egcs-2.91.57/crtbegin.o -L ../build/bin
-L/usr/lib/gcc-lib/i486-linux/egcs-2.91.57 -lapt-pkg
../build/obj/methods/http.o -lstdc++ -lm -lgcc -lc -lgcc
/usr/lib/gcc-lib/i486-linux/egcs-2.91.57/crtend.o /usr/lib/crtn.o
../build/obj/methods/http.o: In function ServerState::RunHeaders(void)':
/mnt/Big/home/jgg/work/apt/methods/http.cc:341: undefined reference to
ServerState::HeaderLine(basic_string<char, string_char_traits<char>,
__default_alloc_template<true, 0> >)'
../build/obj/methods/http.o: In function HttpMethod::Loop(void)':
/mnt/Big/home/jgg/work/apt/methods/http.cc:778: undefined reference to
__opt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0__C11MD5SumValue'
collect2: ld returned 1 exit status
make: *** [../build/bin/methods/http] Error 1 

-- System Information
Debian Release: 2.0
Kernel Version: Linux Wakko 2.0.34 #4 Sat Jun 6 20:28:53 MDT 1998 i486 
unknown




Information forwarded to debian-bugs-dist@lists.debian.org, Galen Hazelwood <galenh-egcs@debian.org>:
Bug#21122; Package g++. (full text, mbox, link).


Acknowledgement sent to Andrew Macleod <amacleod@cygnus.com>:
Extra info received and forwarded to list. Copy sent to Galen Hazelwood <galenh-egcs@debian.org>. (full text, mbox, link).


Message #41 received at 21122@bugs.debian.org (full text, mbox, reply):

From: Andrew Macleod <amacleod@cygnus.com>
To: doko@cs.tu-berlin.de, egcs-bugs@cygnus.com
Cc: 21122@bugs.debian.org
Subject: Re: g++: LD is not demangling
Date: Mon, 16 Nov 1998 07:51:52 -0800
I applied a patch on friday morning that should fix this problem.
The affected file was cplus-dem.c. ( I posted the patch earlier
last week, but here it is again)

Presumably this should go into 1.1.1

Andrew

---------------------------------------

This patch should solve the problem with the underscores in the
class name.  Now we look for the final __ instead of the second one
when looking for the signature:
  __opt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0__1C

now demangles to

C::operator basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> >(void)

Index: cplus-dem.c
===================================================================
RCS file: /cvs/cvsfiles/devo/libiberty/cplus-dem.c,v
retrieving revision 1.92
diff -c -p -r1.92 cplus-dem.c
*** cplus-dem.c	1998/10/09 21:08:37	1.92
--- cplus-dem.c	1998/11/11 19:35:33
*************** demangle_prefix (work, mangled, declp)
*** 1926,1932 ****
  	    }
  	  else
  	    {
! 	      demangle_function_name (work, mangled, declp, scan);
  	    }
  	}
      }
--- 1926,1940 ----
  	    }
  	  else
  	    {
!               const char *tmp;
!               /* Look for the LAST occurrence of __, allowing names to have
!                  the '__' sequence embedded in them.*/
!               while ((tmp = mystrstr (scan+2, "__")) != NULL)
!                 scan = tmp;
!               if (*(scan + 2) == '\0')
!                 success = 0;
!               else
!                 demangle_function_name (work, mangled, declp, scan);
  	    }
  	}
      }



Changed bug title. Request was from Matthias Klose <doko@cs.tu-berlin.de> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Galen Hazelwood <galenh-egcs@debian.org>:
Bug#21122; Package g++. (full text, mbox, link).


Acknowledgement sent to law@cygnus.com:
Extra info received and forwarded to list. Copy sent to Galen Hazelwood <galenh-egcs@debian.org>. (full text, mbox, link).


Message #48 received at 21122@bugs.debian.org (full text, mbox, reply):

From: Jeffrey A Law <law@hurl.cygnus.com>
To: Andrew Macleod <amacleod@cygnus.com>
Cc: doko@cs.tu-berlin.de, egcs-bugs@cygnus.com, 21122@bugs.debian.org
Subject: Re: g++: LD is not demangling
Date: Mon, 23 Nov 1998 09:52:47 -0700
  In message <199811161551.HAA01253@rtl.cygnus.com>you write:
  > I applied a patch on friday morning that should fix this problem.
  > The affected file was cplus-dem.c. ( I posted the patch earlier
  > last week, but here it is again)
  > 
  > Presumably this should go into 1.1.1
  > 
  > Andrew
  > 
  > ---------------------------------------
  > 
  > This patch should solve the problem with the underscores in the
  > class name.  Now we look for the final __ instead of the second one
  > when looking for the signature:
  >   __opt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_templa
  > te2b0i0__1C
  > 
  > now demangles to
  > 
  > C::operator basic_string<char, string_char_traits<char>, __default_alloc_te
  > mplate<false, 0> >(void)
Thanks.  I've installed this into the egcs-1.1.1 tree.
jeff


Bug reassigned from package `g++' to `g++272'. Request was from Matthias Klose <doko@cs.tu-berlin.de> to control@bugs.debian.org. (full text, mbox, link).


Severity set to `fixed'. Request was from Matthias Klose <doko@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Reply sent to Matthias Klose <doko@cs.tu-berlin.de>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Herbert Xu <herbert@gondor.apana.org.au>:
Bug acknowledged by developer. (full text, mbox, link).


Message #57 received at 21122-done@bugs.debian.org (full text, mbox, reply):

From: Matthias Klose <doko@cs.tu-berlin.de>
To: 42532-done@bugs.debian.org, 35906-done@bugs.debian.org, 39098-done@bugs.debian.org, 36182-done@bugs.debian.org, 42584-done@bugs.debian.org, 42585-done@bugs.debian.org, 42602-done@bugs.debian.org, 42742-done@bugs.debian.org, 42743-done@bugs.debian.org, 43002-done@bugs.debian.org, 42622-done@bugs.debian.org, 21122-done@bugs.debian.org, 22513-done@bugs.debian.org, 28417-done@bugs.debian.org, 41302-done@bugs.debian.org, 41313-done@bugs.debian.org, 40659-done@bugs.debian.org
Subject: Fixed in gcc-2.95.1-0pre1
Date: Mon, 16 Aug 1999 10:43:16 +0200 (MET DST)
These bugs are fixed in the gcc-2.95.1-0pre1 and related g++,
libstdc++, cpp packages. Binary packages are currently uploaded for
the i386-hurd architecture.


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 26 12:48:18 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.