mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Add support for character literals in macros (#6419)
Adding support for macros with character literals. Part of #6303
This commit is contained in:
@@ -2298,6 +2298,13 @@ static auto MapConstant(Context& context, SemIR::LocId loc_id,
|
||||
MakeImportedLocIdAndInst<SemIR::FloatValue>(
|
||||
context, imported_loc_id,
|
||||
{.type_id = type_id, .float_id = float_id}));
|
||||
} else if (auto* character_literal =
|
||||
dyn_cast<clang::CharacterLiteral>(expr)) {
|
||||
inst_id = AddInstInNoBlock(
|
||||
context, MakeImportedLocIdAndInst<SemIR::CharLiteralValue>(
|
||||
context, imported_loc_id,
|
||||
{.type_id = type_id,
|
||||
.value = SemIR::CharId(character_literal->getValue())}));
|
||||
} else {
|
||||
context.TODO(loc_id, llvm::formatv(
|
||||
"Unsupported: C++ constant expression type: '{0}'",
|
||||
|
||||
Reference in New Issue
Block a user