c++/317: Defining a pointer-to-(function-returning-pointer-to-function) rejected
rovf@earthling.net
rovf@earthling.net
Wed Jun 14 00:16:00 GMT 2000
>Number: 317
>Category: c++
>Synopsis: Defining a pointer-to-(function-returning-pointer-to-function) rejected
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Jun 14 00:16:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Ronald Fischer
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
> uname -a
SunOS ix05 5.7 Generic_106541-10 sun4u sparc SUNW,Ultra-1
>Description:
A legal definition like
(char(*)(int)) (* x) (long const*, wchar_t);
(i.e. x is a pointer to a function accepting a (long const*)
and a wchar_t, and returning in turn a pointer to a function
accepting an int and returning a char) is rejected with
the error message
parse error before `char'
>How-To-Repeat:
Just compile this file (with gcc -c).
>Fix:
Provide a typedef for the resulting type, i.e.
typedef char(*F)(int);
F (* x) (long const*, wchar_t);
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.cc"
KGNoYXIoKikoaW50KSkgKCogeCkgKGxvbmcgY29uc3QqLCB3Y2hhcl90KTsK
More information about the Gcc-prs
mailing list