Files
clang-p2996/lldb/test/lang/cpp/static_methods/main.cpp
Sean Callanan 763d72a1fd Fixed a bug in which the DWARF reader did not distinguish
appropriately between C++ static methods and non-static
methods.  This bug made it impossible to call most static
methods, either because Clang did not recognize that a
method could be called without providing a "this"
parameter, or because Clang did not properly mangle the
name of the method when searching for it in the target.

Also added a testcase.

llvm-svn: 136733
2011-08-02 22:21:50 +00:00

39 lines
674 B
C++

//===-- main.cpp ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include <stdio.h>
class A
{
public:
static int getStaticValue();
int getMemberValue();
int a;
};
int A::getStaticValue()
{
return 5;
}
int A::getMemberValue()
{
return a;
}
int main()
{
A my_a;
my_a.a = 3;
printf("%d\n", A::getStaticValue()); // Break at this line
printf("%d\n", my_a.getMemberValue());
}