Add support for string literals in macros (#6408)

Adding support for macros with string literals.

Part of #6303
This commit is contained in:
Ivana Ivanovska authored and GitHub committed 2025-11-21 12:33:18 +00:00
1 parent 00ee693833
commit 8866e39085
3 files changed
+111 -15

No files matched your search

+4
View File
@@ -61,6 +61,10 @@ auto TryEvaluateMacroToConstant(Context& context, SemIR::LocId loc_id,
return nullptr;
}
if (isa<clang::StringLiteral>(result_expr)) {
return result_expr;
}
clang::Expr::EvalResult evaluated_result;
CARBON_CHECK(result_expr->EvaluateAsConstantExpr(evaluated_result,
sema.getASTContext()));