C = *(++TokenEnd);
NumWhitespaceChars++;
}
- if (isVerticalWhitespace(C))
+
+ // Skip \r, \n, \r\n, or \n\r
+ if (C == '\n' || C == '\r') {
+ char PrevC = C;
+ C = *(++TokenEnd);
NumWhitespaceChars++;
+ if ((C == '\n' || C == '\r') && C != PrevC)
+ NumWhitespaceChars++;
+ }
}
return TokenLoc.getLocWithOffset(Tok.getLength() + NumWhitespaceChars);
--- /dev/null
+// RUN: %clang_cc1 -pedantic -Wunused-label -x c %s 2>&1 | FileCheck %s -strict-whitespace\r
+\r
+// This file intentionally uses a CRLF newline style\r
+// <rdar://problem/12639047>\r
+// CHECK: warning: unused label 'ddd'\r
+// CHECK-NEXT: {{^ ddd:}}\r
+// CHECK-NEXT: {{^ \^~~~$}}\r
+void f() {\r
+ ddd:\r
+ ;\r
+}\r