mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-22 18:42:38 +00:00
Add support for string literals in macros (#6408)
Adding support for macros with string literals. Part of #6303
This commit is contained in:
1 parent
00ee693833
commit
8866e39085
3 files changed
+111
-15
No files matched your search
@@ -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