This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[herbert@gondor.apana.org.au: Bug#21122: g++: eg++ doesn't compile programs accepted by g++]
- To: egcs-bugs at cygnus dot com
- Subject: [herbert@gondor.apana.org.au: Bug#21122: g++: eg++ doesn't compile programs accepted by g++]
- From: jdassen at wi dot leidenuniv dot nl
- Date: Wed, 22 Apr 1998 09:19:47 +0200
- Cc: 21122 at bugs dot debian dot org
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
- To: submit at bugs dot debian dot org
- Subject: Bug#21122: g++: eg++ doesn't compile programs accepted by g++
- From: Herbert Xu <herbert at gondor dot apana dot org dot au>
- Date: Tue, 14 Apr 1998 22:28:46 +1000
- Reply-To: Herbert Xu <herbert at gondor dot apana dot org dot au>, 21122 at bugs dot debian dot org
- Resent-CC: Galen Hazelwood <galenh at micron dot net>
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
- To: 21122 at bugs dot debian dot org
- Subject: Bug#21122: g++: eg++ doesn't compile programs accepted by g++
- From: jdassen at wi dot leidenuniv dot nl
- Date: Tue, 14 Apr 1998 15:52:07 +0200
- References: <199804141228.WAA18379@gondor.apana.org.au>
- Reply-To: jdassen at wi dot leidenuniv dot nl, 21122 at bugs dot debian dot org
- Resent-CC: Galen Hazelwood <galenh at micron dot net>
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
- To: 21122 at bugs dot debian dot org
- Subject: Bug#21122: g++: eg++ doesn't compile programs accepted by g++
- From: Herbert Xu <herbert at gondor dot apana dot org dot au>
- Date: Wed, 22 Apr 1998 08:57:06 +1000 (EST)
- Reply-To: Herbert Xu <herbert at gondor dot apana dot org dot au>, 21122 at bugs dot debian dot org
- Resent-CC: Galen Hazelwood <galenh at micron dot net>
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