[libclang] Make clang_getCursor able to handle locations that point inside macro arguments.
e.g. for:
\define INVOKE(METHOD, CLASS) [CLASS METHOD]
void test2() {
INVOKE(meth, MyClass);
}
Pointing at 'meth' will give a CXCursor_ObjCMessageExpr and pointing at 'MyClass'
will give a CXCursor_ObjCClassRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137796 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/get-cursor-macro-args.h b/test/Index/get-cursor-macro-args.h
new file mode 100644
index 0000000..40ec8dc
--- /dev/null
+++ b/test/Index/get-cursor-macro-args.h
@@ -0,0 +1,16 @@
+@interface MyClass
++(void)meth;
+@end
+
+#define MACRO2(x) x
+#define MACRO(x) MACRO2(x)
+
+void test() {
+ MACRO([MyClass meth]);
+}
+
+#define INVOKE(METHOD, CLASS) [CLASS METHOD]
+
+void test2() {
+ INVOKE(meth, MyClass);
+}