public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34691]  New: Default argument checking not performed after overload resolution.
@ 2008-01-06 20:31 rideau3 at gmail dot com
  2008-01-06 21:38 ` [Bug c++/34691] [4.1/4.2/4.3 Regression] Default argument checking not performed after overload resolution with C linkage rguenth at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: rideau3 at gmail dot com @ 2008-01-06 20:31 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-04-08  3:56 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-06 20:31 [Bug c++/34691] New: Default argument checking not performed after overload resolution rideau3 at gmail dot com
2008-01-06 21:38 ` [Bug c++/34691] [4.1/4.2/4.3 Regression] Default argument checking not performed after overload resolution with C linkage rguenth at gcc dot gnu dot org
2008-01-11  8:18 ` jakub at gcc dot gnu dot org
2008-01-11 13:49 ` jakub at gcc dot gnu dot org
2008-01-11 14:12 ` jakub at gcc dot gnu dot org
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:32 ` [Bug c++/34691] [4.1/4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-07-04 22:55 ` [Bug c++/34691] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-01-16 20:03 ` jason at gcc dot gnu dot org
2009-02-11 21:31 ` jason at gcc dot gnu dot org
2009-03-25 21:10 ` jason at gcc dot gnu dot org
2009-03-26 16:10 ` jason at gcc dot gnu dot org
2009-03-31 20:19 ` [Bug c++/34691] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-04-01  3:34 ` jason at gcc dot gnu dot org
2009-04-01 15:21 ` jason at gcc dot gnu dot org
2009-04-01 15:29 ` jason at gcc dot gnu dot org
2009-04-08  3:45 ` jason at gcc dot gnu dot org
2009-04-08  3:55 ` jason at gcc dot gnu dot org
2009-04-08  3:56 ` jason at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).