Parsing of `#line` preprocessor directive is wrong when `\\` is present in the filename argument
Open
clang:frontend
diverges-from:edg
diverges-from:gcc
diverges-from:msvc
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```c
#include
int main() {
#line 10 "not_a_\\tab"
const char *actual = __FILE__;
const char *expected = "not_a_\\tab";
return strcmp(actual, expected);
}
```
The string comparison should return 0, but it returns a non-zero value.
Contributor guide
Research direction
Start by compiling and running the supplied C reproducer, focusing on how the #line filename argument containing \\ is parsed and used for __FILE__. Trace that preprocessor path to identify the incorrect handling, then verify that the comparison returns zero and add a regression test if the existing test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100