Use some heuristics so that when a fixit removes a source range, we try
to also remove a trailing space if possible.
For example, removing '__bridge' from:
i = (__bridge I*)p;
should result in:
i = (I*)p;
not:
i = ( I*)p;
rdar://11314821
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170764 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/FixIt/bridge-in-non-arc.m b/test/FixIt/bridge-in-non-arc.m
new file mode 100644
index 0000000..948fa8e
--- /dev/null
+++ b/test/FixIt/bridge-in-non-arc.m
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+@interface I
+@end
+
+void foo(void *p) {
+ I *i = (__bridge I*)p;
+ I *i2 = (__bridge/*cake*/I*)p;
+}
+
+// CHECK: {7:11-7:20}:""
+// CHECK: {8:12-8:20}:""