[clang] Line and digit directives, OriginalFileName, ModuleName should be unevaluated strings (PR #201413)

Abhina Sree via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 25 05:58:52 PDT 2026


================
@@ -525,7 +525,8 @@ static SourceLocation ReadOriginalFileName(CompilerInstance &CI,
   if (T.isAtStartOfLine() || T.getKind() != tok::string_literal)
     return SourceLocation();
 
-  StringLiteralParser Literal(T, CI.getPreprocessor());
+  StringLiteralParser Literal(T, CI.getPreprocessor(),
+                              StringLiteralEvalMethod::Unevaluated);
----------------
abhina-sree wrote:

I added the following test now for this:
clang/test/Frontend/linemarker-invalid-escape.c

Please let me know if this is sufficient for I need more

https://github.com/llvm/llvm-project/pull/201413


More information about the cfe-commits mailing list