c++/5053: g++ 2.95.3 cannot call non-static template members from template functions.

raabe@kde.org raabe@kde.org
Sun Dec 9 08:12:00 GMT 2001


>Number:         5053
>Category:       c++
>Synopsis:       g++ 2.95.3 cannot call non-static template members from template functions.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 09 02:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Frerich Raabe
>Release:        2.95.3
>Organization:
>Environment:
AMD Duron, SuSE Linux 7.3 Professional, Kernel 2.4.10-4GB, libc 2.2.4, binutils 2.11.90
>Description:
g++ 2.95.3 fails to compile the attached code, displaying the error message

main.cpp: In function `void fooWrapper()':
main.cpp:14: parse error before `>'
>How-To-Repeat:
Compile the attached sourcecode via 'g++ -o main main.cpp'.
>Fix:
I noticed two workarounds for the problem:
a) Making Foo::bar() static and calling 'Foo::bar<T>()' from fooWrapper().
b) Move the code in fooWrapper() into main().
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="main.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="main.cpp"

Y2xhc3MgRm9vCnsKCXB1YmxpYzoKCQl0ZW1wbGF0ZSA8Y2xhc3MgVD4KCQlzdGF0aWMgdm9pZCBi
YXIoKSB7IH0KfTsKCmNsYXNzIER1bW15IHsgfTsKCnRlbXBsYXRlIDxjbGFzcyBUPgp2b2lkIGZv
b1dyYXBwZXIoKQp7CglGb28gZm9vOwoJZm9vLmJhcjxUPigpOwp9CgppbnQgbWFpbigpCnsKCWZv
b1dyYXBwZXI8RHVtbXk+KCk7Cn0K



More information about the Gcc-bugs mailing list