teak-llvm/clang/test/Tooling/Inputs/clang-diff-basic-src.cpp
Johannes Altmanninger 51321aef8e [clang-diff] Simplify mapping
Summary:
Until we find a decent heuristic on how to choose between multiple
identical trees, there is no point in supporting multiple mappings.

This also enables matching of nodes with parents of different types,
because there are many instances where this is appropriate.  For
example for and foreach statements; functions in the global or
other namespaces.

Reviewers: arphaman

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D36183

llvm-svn: 311251
2017-08-19 17:53:01 +00:00

34 lines
403 B
C++

namespace src {
void foo() {
int x = 321;
}
void main() { foo(); };
const char *a = "foo";
typedef unsigned int nat;
int p = 1 * 2 * 3 * 4;
int squared = p * p;
class X {
const char *foo(int i) {
if (i == 0)
return "foo";
return 0;
}
public:
X(){};
int id(int i) { return i; }
};
}
void m() { int x = 0 + 0 + 0; }
int um = 1 * 2 + 3;
void f1() {{ (void) __func__;;; }}