From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12776 invoked by alias); 13 Sep 2002 16:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 12762 invoked by uid 71); 13 Sep 2002 16:26:01 -0000 Date: Fri, 13 Sep 2002 09:26:00 -0000 Message-ID: <20020913162601.12761.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Krzysztof Parzyszek Subject: Re: c++/7844: Function declarations parsed incorrectly Reply-To: Krzysztof Parzyszek X-SW-Source: 2002-09/txt/msg00245.txt.bz2 List-Id: The following reply was made to PR c++/7844; it has been noted by GNATS. From: Krzysztof Parzyszek To: lerdsuwa@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, kparz@iastate.edu, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/7844: Function declarations parsed incorrectly Date: Fri, 13 Sep 2002 11:15:23 -0500 On Fri, Sep 13, 2002 at 04:03:47PM -0000, lerdsuwa@gcc.gnu.org wrote: > Synopsis: Function declarations parsed incorrectly > > State-Changed-Why: > Not a bug. > The declaration of 'foo' is parsed as > void foo(int I) > i.e., a function accepting an integer parameter named 'I'. > The 'I' inside 'foo' hides the global typedef 'I'. 7 Another ambiguity arises in a parameter-declaration-clause of a func- tion declaration, or in a type-id that is the operand of a sizeof or typeid operator, when a type-name is nested in parentheses. In this case, the choice is between the declaration of a parameter of type pointer to function and the declaration of a parameter with redundant parentheses around the declarator-id. The resolution is to consider the type-name as a simple-type-specifier rather than a declarator-id. [Example: class C { }; void f(int(C)) { } // void f(int (*fp)(C c)) { } // not: void f(int C); -- <>> kristof@swissmail.org 9/2/2002 <<> "If you can't convince them, confuse them" -- HS Truman