mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 19:01:05 +01:00
C++ Interop: Add Core.CppCompat.Long32 as a distinct type for Cpp.long when long is 32 bits (#6364)
For now, only support implicit conversions from and to `i32`. See #6275 for rationale. Part of #5263.
This commit is contained in:
@@ -1112,6 +1112,11 @@ static auto MapBuiltinIntegerType(Context& context, SemIR::LocId loc_id,
|
||||
return ExprAsType(context, Parse::NodeId::None,
|
||||
MakeCharTypeLiteral(context, Parse::NodeId::None));
|
||||
}
|
||||
if (ast_context.hasSameType(qual_type, ast_context.LongTy) && width == 32) {
|
||||
return ExprAsType(context, Parse::NodeId::None,
|
||||
LookupNameInCore(context, Parse::NodeId::None,
|
||||
{"CppCompat", "Long32"}));
|
||||
}
|
||||
return TypeExpr::None;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user