This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49574] New: Give a warning for insane overloading


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49574

           Summary: Give a warning for insane overloading
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: djszapi@archlinux.us


It would be nice to get some warning in case of library developers, for
instance in the following situation:

foobar.h

Class FooBar 
...
int foobar(int i, bool b = false);
int foobar(int i);
...

The second method cannot be just used by the foobar(5) method call and all the
standalones will fail to compile and build their application. There is no
restriction to use those methods inside the library, thus the insane usage can
remain hidden. 

However it would be nice if -Wall/extra would provide an opportunity (in this
case, for library developers) to make a proper code.

It is debatable whether or not it should be a code analyzer task, but it is
more serious issue than a directly unitialized warning or unused variable. I
always get those for -Wall and it is less harm though. 

What is your thought ? I am really sorry, if there is already a bugreport like
this. Unfortunately I could not find anything yet. 

If I missed something, just please fix me and I am really sorry then. ;-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]