This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB 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]

c++/912: overloaded static member functions


>Number:         912
>Category:       c++
>Synopsis:       overloaded static member functions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 08 09:18:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     kraftche@cae.wisc.edu
>Release:        5.3
>Organization:
>Environment:
linux
>Description:
gdb won't resolve overloaded static member functions
>How-To-Repeat:
#!/bin/sh

cat >gdb-overload.cpp <<FILE 
#include <iostream>

class A
{
  public:
  
    static int foo()
      { return 1; }

    static int foo(int i)
      { return i+1; }

    static int foo(int i, int j)
      { return i + j + 1; }
};

int main()
{
  int i = 1, j = 2;
  
  std::cout << A::foo() << std::endl;
}
FILE

g++ -g gdb-overload.cpp -o over
gdb over <<GDB
break 20
run
print A::foo()
print A::foo(1)
print A::foo(1,2)
quit
GDB
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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