This prevents clang-format from inadvertently joining stuff into macro
definitions as reported in llvm.org/PR23466.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236944
91177308-0d34-0410-b5e6-
96231b3b80d8
// See whether there is an odd number of '\' before this.
unsigned count = 0;
for (; pos >= 0; --pos, ++count)
- if (Text[count] != '\\')
+ if (Text[pos] != '\\')
break;
return count & 1;
};
EXPECT_EQ(
"#define A \\\n int i; \\\n int j;",
format("#define A \\\nint i;\\\n int j;", getLLVMStyleWithColumns(11)));
+ EXPECT_EQ(
+ "#define A\n\nint i;", format("#define A \\\n\n int i;"));
EXPECT_EQ("template <class T> f();", format("\\\ntemplate <class T> f();"));
EXPECT_EQ("/* \\ \\ \\\n*/", format("\\\n/* \\ \\ \\\n*/"));
EXPECT_EQ("<a\n\\\\\n>", format("<a\n\\\\\n>"));