unsigned LastColumnModified
= HintColNo + I->CodeToInsert.size();
- if (LastColumnModified <= static_cast<unsigned>(map.bytes()))
+ if (LastColumnModified <= static_cast<unsigned>(map.bytes())) {
+ // If we're right in the middle of a multibyte character skip to
+ // the end of it.
+ while (map.byteToColumn(LastColumnModified) == -1)
+ ++LastColumnModified;
LastColumnModified = map.byteToColumn(LastColumnModified);
+ }
if (LastColumnModified > FixItInsertionLine.size())
FixItInsertionLine.resize(LastColumnModified, ' ');
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s
+// PR13312
+
+struct Foo {
+ int bar;
+};
+
+void test1() {
+ struct Foo foo;
+ (&foo)☃>bar = 42;
+// CHECK: error: expected ';' after expression
+// Make sure we emit the fixit right in front of the snowman.
+// CHECK: {{^ \^$}}
+// CHECK: {{^ ;$}}
+}