mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 02:30:28 +00: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:
1 parent
e62678e682
commit
bc734bb768
7 files changed
+368
-123
No files matched your search
@@ -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