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]
Other format: [Raw text]

c++/9783: Can't forward reference class in argument to templated method.


>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:


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