This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: gcc 3.1: bug with inherited templates when specified by namespace
- From: "Mountfort, Geoff" <gmountfort at avaya dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 24 Jun 2002 16:30:59 +1000
- Subject: RE: gcc 3.1: bug with inherited templates when specified by namespace
Dylan,
my previous reply suffered from "hit Send before thinking". The error refers
to line 13, which consists of the two words "template parameter?". Don't you
just love word wrap? Back to the original question ...
namespace SomeSpace
{
template< class T >
class Frog
{
T m_t; // doesn't matter what's here
};
}
class MrBlobbyBlab : public SomeSpace::Frog
{
};
compiles. But
namespace SomeSpace
{
template< class T >
class Frog
{
T m_t; // doesn't matter what's here
};
}
using namespace SomeSpace;
class MrBlobbyBlab : public Frog
{
};
doesn't compile, getting
Frog.cpp:13: parse error before `{' token
Geoff
-----Original Message-----
From: Dylan Cuthbert [mailto:dylan@q-games.com]
Sent: Monday, 24 June 2002 3:08 PM
To: gcc@gcc.gnu.org
Cc: Mountfort, Geoff
Subject: Re: gcc 3.1: bug with inherited templates when specified by
namespace
That's very strange - maybe my use of "other" conflicts with something ( I
think I simplified it to "other" for the example because I didn't think
there was any conflict), please could you try changing the namespace name
from other to something else.
Regards
---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com
----- Original Message -----
From: "Mountfort, Geoff" <gmountfort@avaya.com>
To: <gcc@gcc.gnu.org>
Sent: Monday, June 24, 2002 7:46 AM
Subject: RE: gcc 3.1: bug with inherited templates when specified by
namespace
> Dylan,
>
> I get
> Frog.cpp:13: parse error before `template'
> from
> namespace other
> {
> template< class T >
> class Frog
> {
> T m_t; // doesn't matter what's here
> };
>
> }
>
>
> class MrBlobbyBlab : public other::Frog // erm... where's the
> template parameter?
> {
> };
> with
> g++ (GCC) 3.1
> on
> CYGWIN_NT-5.0 DUKE 1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown
>
>
> Geoff
>
>
> -----Original Message-----
> From: Dylan Cuthbert [mailto:dylan@q-games.com]
> Sent: Sunday, 23 June 2002 4:23 PM
> To: gcc@gcc.gnu.org
> Subject: gcc 3.1: bug with inherited templates when specified by
> namespace
>
>
> namespace other
> {
> template< class T >
> class Frog
> {
> ... // doesn't matter what's here
> };
>
> }
>
>
> class MrBlobbyBlab : public other::Frog // erm... where's the
> template parameter?
> {
> };
>
>
> The problem is that the above code compiles with no warning or error and
> puts god knows what into MrBlobbyBlab as a base class. Put anything in
> "Frog" and it just doesn't matter.
>
> Put a "using namespace other" and change other::Frog to simply Frog and it
> comes up with an error as it properly should.
>
> This is with gcc v3.1 in Cygwin. Can anyone else confirm this problem?
>
> Regards
>
> Dylan Cuthbert, Q-Games Ltd.
>