LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 10153 - clang preprocessor crashes when using -E -CC option on MFC code.
Summary: clang preprocessor crashes when using -E -CC option on MFC code.
Status: REOPENED
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: trunk
Hardware: PC Windows NT
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
: 10683 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-18 23:25 PDT by Francois Pichet
Modified: 2015-08-05 02:13 PDT (History)
7 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Pichet 2011-06-18 23:25:31 PDT
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
Comment 1 Francois Pichet 2011-08-17 11:42:10 PDT
*** Bug 10683 has been marked as a duplicate of this bug. ***
Comment 2 Paul Eremeeff 2011-08-18 00:58:32 PDT
It has nothing to do with MFC though. Any file containing "//\" with an empty line afterwards will cause a crash.
Comment 3 Paul Eremeeff 2011-08-22 08:16:29 PDT
This code:
  // \  
int a; //dead line

Will be preprocessed as:
 // int a; //dead line

Thus the second line is lost.
Comment 4 Argyrios Kyrtzidis 2011-12-21 14:20:18 PST
Fixed in r147091.
Comment 5 Ilya Ivanov 2015-08-05 02:13:32 PDT
The bug is active in clang 3.6.2. This code:

int main(int argc, char* argv[]) {
	// \
	int a; //dead line
	int b;
	return 0;
}

is preprocessed as:

int main(int argc, char* argv[]) {


	int b;
	return 0;
}