std::string &FixItInsertionLine,
unsigned EndOfCaretToken,
unsigned Columns) {
- if (CaretLine.size() > SourceLine.size())
- SourceLine.resize(CaretLine.size(), ' ');
-
+ unsigned MaxSize = std::max(SourceLine.size(),
+ std::max(CaretLine.size(),
+ FixItInsertionLine.size()));
+ if (MaxSize > SourceLine.size())
+ SourceLine.resize(MaxSize, ' ');
+ if (MaxSize > CaretLine.size())
+ CaretLine.resize(MaxSize, ' ');
+ if (!FixItInsertionLine.empty() && MaxSize > FixItInsertionLine.size())
+ FixItInsertionLine.resize(MaxSize, ' ');
+
// Find the slice that we need to display the full caret line
// correctly.
unsigned CaretStart = 0, CaretEnd = CaretLine.size();
-// RUN: %clang_cc1 -fmessage-length 72 %s 2>&1 | FileCheck -strict-whitespace %s
-// RUN: %clang_cc1 -fmessage-length 1 %s
-
+// RUN: not %clang_cc1 -fmessage-length 72 %s 2>&1 | FileCheck -strict-whitespace %s
+// RUN: not %clang_cc1 -fmessage-length 1 %s
+// RUN: not %clang_cc1 -fmessage-length 8 %s 2>&1 | FileCheck -check-prefix=CHECK-DOT %s
// Hack so we can check things better, force the file name and line.
# 1 "FILE" 1
// CHECK: FILE:23:78
// CHECK: {{^ ...// some long comment text and a brace, eh {} }}
+
+struct A { int x; };
+void h(struct A *a) {
+ // CHECK-DOT: member
+ // CHECK-DOT: reference
+ // CHECK-DOT: type
+ (void)a
+ .
+ x;
+}