This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

namespace with Template bug



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]