Template vs. Expression bug

Giuliano Procida myxie@debian.org
Wed Nov 10 09:28:00 GMT 1999


Some time ago I reported a template-related bug (see end), since
fixed. However, I have now run into a related problem for which I have
not yet been able to construct a small test case. This new problem did
not exist until the fix for the bug here.

Some code does something like:

#include <list>
struct A { ... };
class B {
  ...
  const A & list;
  int foo () { ... list.xyz ... };
};

And I get told that this is a "use of class template `template <class
_Tp, class _Alloc = class allocator<_Tp1> > list<_Tp,_Alloc>' as
expression".

The problem disappears if the #include <list> is moved below the other
occurrences of "list". I will try to produce a small example that
exhibits the same behaviour.

Giuliano.

----- Forwarded message from Giuliano Procida <myxie@debian.org> -----

Date: Thu, 26 Aug 1999 18:09:23 +0100
From: Giuliano Procida <myxie@debian.org>
To: gcc-bugs@gcc.gnu.org
Subject: g++ 2.95.1 i386-linux internal error (smaller!)
User-Agent: Mutt/0.95.7i

// this kills it

class z { };

template <typename T> struct t {
};

int main () {
  z kitty;
  kitty.t.bar ("foo");
}

----- End forwarded message -----


More information about the Gcc-bugs mailing list