c++/8921: Trouble with member templates

evirt@iis.sinica.edu.tw evirt@iis.sinica.edu.tw
Fri Dec 13 02:06:00 GMT 2002


>Number:         8921
>Category:       c++
>Synopsis:       Trouble with member templates
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 13 02:06:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Chin-Lung Chang
>Release:        3.2 20020903
>Organization:
>Environment:
Red Hat Linux 8.0 3.2-7
>Description:
The following code is rejected by gcc:

----------------snip here------------------
struct A
{
   template <typename T> void foo();
};

template <typename T> void bar(A& a)
{
    a.foo<T>();
}

void baz()
{
    A a;
    bar<int>(a);
}
----------------snip here------------------

bug.cc: In function `void bar(A&)':
bug.cc:8: error: parse error before `>' token
>How-To-Repeat:
g++ -c bug.cc
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list