[PATCH] D96363: Mark output as text if it is really text
Alexandre Ganea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 25 07:06:44 PDT 2021
aganea added a comment.
Hello! This patch breaks compilation when using `-frewrite-includes` on Windows. It adds an extra line with CRLF, which causes compilation failures with macros line-breaks:
$ cat -A hello.cpp
int foo();^M$
int bar();^M$
#define HELLO \^M$
foo(); \^M$
bar();^M$
^M$
int main() {^M$
HELLO^M$
return 0;^M$
}
$ clang-cl /E -Xclang -frewrite-includes hello.cpp > test.cpp
$ cat -A test.cpp
# 1 "<built-in>"^M^M$
# 1 "hello.cpp"^M^M$
int foo();^M^M$
int bar();^M^M$
#define HELLO \^M^M$
foo(); \^M^M$
bar();^M^M$
^M^M$
int main() {^M^M$
HELLO^M^M$
return 0;^M^M$
}^M^M$
$ clang-cl /c test.cpp
hello.cpp(8,3): error: C++ requires a type specifier for all declarations
foo(); \
^
hello.cpp(10,3): error: C++ requires a type specifier for all declarations
bar();
^
2 errors generated.
$ clang-cl /c hello.cpp
$
@abhina.sreeskantharajan would you have a chance to take a look please?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96363/new/
https://reviews.llvm.org/D96363
More information about the llvm-commits
mailing list