This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
namespace with Template bug
- To: gcc-bugs at egcs dot cygnus dot com, tromey at cygnus dot com
- Subject: namespace with Template bug
- From: Paul Matthew Reilly <paul at pajato dot com>
- Date: Tue, 17 Aug 1999 06:19:00 -0400
- Reply-to: paul at pajato dot com
My previous post didn't include a full example so here is something
that should reproduce the problem I'm having:
#include <java-array.h>
extern "Java"
{
namespace gnu
{
namespace java
{
class List;
};
};
namespace java
{
namespace lang
{
class String;
};
};
};
class gnu::java::List
{
public:
virtual void createList (JArray<::java::lang::String *> *) {};
};
Here is what I use to compile it:
g++ -I/usr/local/src/libgcj/libjava/include \
-I/usr/local/src/libgcj/libjava \
-I/usr/local/src/libgcj/objdir/i686-pc-linux-gnu/libjava \
-I/usr/local/src/libgcj/objdir/i686-pc-linux-gnu/libjava/include \
-c List.cc -o List
Here is the output:
List.cc:24: use of class template `template <class T> JArray<T>' as expression
List.cc:24: parse error before `:'
If I use the following line instead:
virtual void createList (JArray<java::lang::String *> *) {};
I get this for output:
List.cc:24: `lang' undeclared in namespace `gnu::java'
List.cc:24: parse error before `::'
GCC version: 2.95
System type: i686-pc-linux-gnu (Redhat 6.0)
I hope this is enough to go on.
-Paul