This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9783: Can't forward reference class in argument to templated method.
- From: mleone at pixar dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Feb 2003 23:19:25 -0000
- Subject: c++/9783: Can't forward reference class in argument to templated method.
- Reply-to: mleone at pixar dot com
>Number: 9783
>Category: c++
>Synopsis: Can't forward reference class in argument to templated method.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Feb 20 23:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Mark Leone
>Release: g++ 3.2
>Organization:
>Environment:
RedHat 7.2, i686 multiprocessor
>Description:
The following fails to compile. Workaround is to declare forward reference to class outside the template.
template<class Info>
class Table {
public:
bool Lookup(int name, class Detail* detail, Info* info) const;
void Insert(int name, class Detail* detail, Info info);
};
class Detail {
public:
int stuff;
};
template<class Info>
bool Table<Info>::Lookup(int name, Detail* detail, Info* info) const {
return true;
}
template<class Info>
void Table<Info>::Insert(int name, Detail* detail, Info info) {
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: