This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/2794: templated method in a templated class cannot be accessed with full qualification
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/2794: templated method in a templated class cannot be accessed with full qualification
- From: fwunderlich at devbrain dot de
- Date: 9 May 2001 22:21:00 -0000
- Reply-To: fwunderlich at devbrain dot de
>Number: 2794
>Category: c++
>Synopsis: templated method in a templated class cannot be accessed with full qualification
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed May 09 15:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: fwunderlich@devbrain.de
>Release: current snapshot; all version at least up to 2001-05-09
>Organization:
>Environment:
any.
http://www.codesourcery.com/gcc-compile.shtml works fine (in showing the bug)
>Description:
See How-To-Repeat.
KAI C++ compiles it, and I am pretty sure it is
well-formed according to the standard.
*Unrelated to the bug*:
I'm not sure wether the first line in m should really
work as C<T>::func is of type
template <class T> void (*)(T)
while func obviously is of type
void (*)(char),
but it does work. Universal conversions for these cases
are obviously trivial but I didn't find anything in the
standard. It would be nice if someone could tell me wether
this is ok (it works in KAI C++ too).
>How-To-Repeat:
template <class T> struct C
{
public:
template <class F> static void func(F)
{}
};
template <class T, class F> void m(F f)
{
void (*func)(F) = C<T>::func; // works
C<T>::func(f); // works
C<T>::func<F>(f); // "parse error before >"
}
int main()
{
m<unsigned, char>(0);
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: