This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34691] New: Default argument checking not performed after overload resolution.
- From: "rideau3 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jan 2008 19:50:58 -0000
- Subject: [Bug c++/34691] New: Default argument checking not performed after overload resolution.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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