From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3345 invoked by alias); 6 Jan 2008 19:51:40 -0000 Received: (qmail 3072 invoked by uid 48); 6 Jan 2008 19:50:58 -0000 Date: Sun, 06 Jan 2008 20:31:00 -0000 Subject: [Bug c++/34691] New: Default argument checking not performed after overload resolution. X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rideau3 at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00530.txt.bz2 The following code is ill-formed according to the standard, but accepted by GCC: namespace A { extern "C" void f(int = 5); } namespace B { extern "C" void f(int = 4); } using A::f; using B::f; int main() { f(3); //OK f(); //ERROR } When a default argument is used as in the second call, it needs to be looked up to make sure it isn't declared twice. If it is, then it's an error. GCC will also accept the code whether the default arguments to f() are given the same or different values. -- Summary: Default argument checking not performed after overload resolution. Product: gcc Version: 4.1.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rideau3 at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34691