This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/9109: parse ambiguity
- From: nathan at codesourcery dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 30 Dec 2002 18:00:02 -0000
- Subject: c++/9109: parse ambiguity
- Reply-to: nathan at codesourcery dot com
>Number: 9109
>Category: c++
>Synopsis: parse ambiguity
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Dec 30 10:06:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: nathan
>Release: HEAD
>Organization:
>Environment:
>Description:
In the attached program the parameter 'int (T)' is parsed
as a parameter of type int called T with redundent parentheses. This is incorrect. It should be parsed as an unnamed parameter of type 'function taking T and returning int'. [8.2]/7 gives this ambiguity and resolution. An example
class C {};
void f(int (C)); //void f (int (*)(C))
is given
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="4672-3.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="4672-3.ii"
dGVtcGxhdGUgPHR5cGVuYW1lIFQ+IHZvaWQgRm9vIChpbnQgKFQpKSB7fQo=