mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 21:31:24 +01:00
Add support for string literals in macros (#6408)
Adding support for macros with string literals. Part of #6303
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user