diff --git a/clang/test/Index/cxx-operator-overload-input.cpp b/clang/test/Index/cxx-operator-overload-input.cpp new file mode 100644 index 000000000000..f0503ae68b11 --- /dev/null +++ b/clang/test/Index/cxx-operator-overload-input.cpp @@ -0,0 +1,12 @@ +class Cls { +public: + Cls operator +(const Cls &RHS); +}; + +static void bar() { + Cls x1, x2, x3; + Cls x4 = x1 + x2 + x3; +} + +Cls Cls::operator +(const Cls &RHS) { +} diff --git a/clang/test/Index/cxx-operator-overload.cpp b/clang/test/Index/cxx-operator-overload.cpp new file mode 100644 index 000000000000..54d6896f3247 --- /dev/null +++ b/clang/test/Index/cxx-operator-overload.cpp @@ -0,0 +1,9 @@ +// RUN: clang-cc -emit-pch %S/cxx-operator-overload-input.cpp -o %t.ast && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:8:17 -print-decls | count 2 && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:8:17 -print-decls | grep ':3:9,' && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:8:17 -print-decls | grep ':11:10,' && + +// Yep, we can show references of '+' plus signs that are overloaded, w00t! +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:3:15 -print-refs | count 2 && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:3:15 -print-refs | grep ':8:17,' && +// RUN: index-test %t.ast -point-at %S/cxx-operator-overload-input.cpp:3:15 -print-refs | grep ':8:22,'