Skip to content

Commit 72fb09f

Browse files
committed
do not translate line/digit directives, do not translate filename
1 parent c1a2c42 commit 72fb09f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

clang/lib/Frontend/FrontendAction.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,9 @@ static SourceLocation ReadOriginalFileName(CompilerInstance &CI,
525525
if (T.isAtStartOfLine() || T.getKind() != tok::string_literal)
526526
return SourceLocation();
527527

528-
StringLiteralParser Literal(T, CI.getPreprocessor());
528+
StringLiteralParser Literal(T, CI.getPreprocessor(),
529+
StringLiteralEvalMethod::Evaluated,
530+
CA_NoConversion);
529531
if (Literal.hadError)
530532
return SourceLocation();
531533
RawLexer->LexFromRawLexer(T);

clang/lib/Lex/PPDirectives.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,8 @@ void Preprocessor::HandleLineDirective() {
15571557
return;
15581558
} else {
15591559
// Parse and validate the string, converting it into a unique ID.
1560-
StringLiteralParser Literal(StrTok, *this);
1560+
StringLiteralParser Literal(
1561+
StrTok, *this, StringLiteralEvalMethod::Evaluated, CA_NoConversion);
15611562
assert(Literal.isOrdinary() && "Didn't allow wide strings in");
15621563
if (Literal.hadError) {
15631564
DiscardUntilEndOfDirective();
@@ -1708,7 +1709,8 @@ void Preprocessor::HandleDigitDirective(Token &DigitTok) {
17081709
return;
17091710
} else {
17101711
// Parse and validate the string, converting it into a unique ID.
1711-
StringLiteralParser Literal(StrTok, *this);
1712+
StringLiteralParser Literal(
1713+
StrTok, *this, StringLiteralEvalMethod::Evaluated, CA_NoConversion);
17121714
assert(Literal.isOrdinary() && "Didn't allow wide strings in");
17131715
if (Literal.hadError) {
17141716
DiscardUntilEndOfDirective();

0 commit comments

Comments
 (0)