================
@@ -4695,11 +4696,17 @@ bool Lexer::LexDependencyDirectiveToken(Token &Result) {
MIOpt.ReadToken();
}
- if (ParsingFilename && DDTok.is(tok::less)) {
- BufferPtr = BufferStart + DDTok.Offset;
- LexAngledStringLiteral(Result, BufferPtr + 1);
- if (Result.isNot(tok::header_name))
+ const char *DDTokPtr = BufferStart + DDTok.Offset;
+ if (ParsingFilename && *DDTokPtr == '<') {
----------------
zygoloid wrote:
What happens if the `<` is immediately after an escaped newline? Eg:
```
... \
<foo>
```
I *think* we use the location of the `\` as the `DDTok.Offset` in this case.
Worth adding a testcase. If it fails, this would be the fix:
```suggestion
const char *DDTokPtr = SkipEscapedNewLines(BufferStart + DDTok.Offset);
if (ParsingFilename && *DDTokPtr == '<') {
```
https://github.com/llvm/llvm-project/pull/191004
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits