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++/12386] New: methode overloading


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: methode overloading
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lauterba at web dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86
  GCC host triplet: Linux
GCC target triplet: x86

The code:

class A{
public:
  void test();  
};

class B:public A{
public :
  void test(int){
    test();
  }
};

int main(){
  B b;
  b.test(2);
  b.test();
}

will produce the the error messages:

classes.cc: In member function `void B::test(int)':
classes.cc:9: error: no matching function for call to `B::test()'
classes.cc:8: error: candidates are: void B::test(int)
classes.cc: In function `int main()':
classes.cc:16: error: no matching function for call to `B::test()'
classes.cc:8: error: candidates are: void B::test(int)
make: *** [classes] Error 1

Is this a bug or C++ standard?


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