c++/10477: Function call not recognized as template
bartoschek@gmx.de
bartoschek@gmx.de
Thu Apr 24 08:36:00 GMT 2003
>Number: 10477
>Category: c++
>Synopsis: Function call not recognized as template
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Apr 24 08:36:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: bartoschek@gmx.de
>Release: 3.2.3
>Organization:
>Environment:
RedHat 9 and Suse Linux 8.2
>Description:
The attached code does not compile. And gives the error
error.C: In member function `void B::f(int)':
error.C:15: parse error before `>' token
The fist < is recognized as operator< and not as the beginning of template arguments.
If you delete Line 11:
class C {};
the code compiles fine. Class C should not affect in any way the behaviour of void B::f(int).
If you delete Class A and use Class C as a template argument:
void B::f(int a)
{
f<C>();
}
it still does not compile. (class C has to be defined between class B and void B::f(int a))
>How-To-Repeat:
g++ -c error.C
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="error.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="error.C"
Y2xhc3MgQSB7fTsKCmNsYXNzIEIKewpwdWJsaWM6CiAgIHRlbXBsYXRlPHR5cGVuYW1lIFQ+CiAg
IGlubGluZSB2b2lkIGYoKSB7fQogICBpbmxpbmUgdm9pZCBmKGludCBhKTsKfTsKCmNsYXNzIEMg
e307Cgp2b2lkIEI6OmYoaW50IGEpCnsKICAgZjxBPigpOwp9Cg==
More information about the Gcc-prs
mailing list