From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26403 invoked by alias); 29 May 2006 22:34:17 -0000 Received: (qmail 26369 invoked by uid 48); 29 May 2006 22:34:09 -0000 Date: Mon, 29 May 2006 22:34:00 -0000 Message-ID: <20060529223409.26368.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/13717] duplicated parameter name not caught ? In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dcb314 at hotmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-05/txt/msg03032.txt.bz2 List-Id: ------- Comment #7 from dcb314 at hotmail dot com 2006-05-29 22:34 ------- (In reply to comment #5) > Based on 8.3.5/8 and the example from 8.3.6/9 which reads > > int f(int a, int b = a); > > I think this bug is invalid and function declarations with duplicate parameter > names are not invalid. I don't understand how the line of code you mention helps demonstrate your logic. Two parameters are declared, one called a and one called b. In the standard, the end of paragraph 8.3.5.7 says If a parameter name is present in a function declaration that is not a definition, it cannot be used outside of the parameter-declaration-clause since it goes out of scope at the end of the function declarator So it implies that a new scope is entered at the ( and exited at the ). But we already know that a name can't be reused at the same scope [ except for function overloading, but that's different]. QED. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717