-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang preprocessor crashes when using -E -CC option on MFC code. #10525
Comments
*** Bug llvm/llvm-bugzilla-archive#10683 has been marked as a duplicate of this bug. *** |
It has nothing to do with MFC though. Any file containing "//" with an empty line afterwards will cause a crash. |
This code: Will be preprocessed as: Thus the second line is lost. |
Fixed in r147091. |
The bug is active in clang 3.6.2. This code: int main(int argc, char* argv[]) { is preprocessed as: int main(int argc, char* argv[]) {
} |
mentioned in issue llvm/llvm-bugzilla-archive#10683 |
Crash was indeed fixed in Clang 3.1: https://godbolt.org/z/cGrxoe5fn As for the last example: int main(int argc, char* argv[]) {
// \
int a; //dead line
int b;
return 0;
} per N4944.lex.phases, backslashes are processed during the second phase, whereas comments are processed during the third phase. Which means |
Extended Description
If you are trying to get the preprocessed output file of a MFC file using the -E -CC options, clang will crash.
Here is a reduction:
test.cpp:
#define A text//\
clang -E -CC test.cpp
The text was updated successfully, but these errors were encountered: