Support for importing const-qualified types from C++. (#5794)

Incidentally also supports import of pointers-to-pointers.

Imported const-qualified types aren't especially useful just yet,
because on the Carbon side we don't yet permit conversions from
non-const to const types, so most of the tests still fail, but for
different reasons now.
This commit is contained in:
Richard Smith
2025-07-12 02:22:24 +00:00
committed by GitHub
parent 27be0973e7
commit a6acba9eab
7 changed files with 215 additions and 118 deletions
+5
View File
@@ -105,6 +105,11 @@ auto GetAssociatedEntityType(Context& context, SemIR::InterfaceId interface_id,
interface_specific_id);
}
auto GetConstType(Context& context, SemIR::TypeInstId inner_type_id)
-> SemIR::TypeId {
return GetTypeImpl<SemIR::ConstType>(context, inner_type_id);
}
auto GetSingletonType(Context& context, SemIR::TypeInstId singleton_id)
-> SemIR::TypeId {
CARBON_CHECK(SemIR::IsSingletonInstId(singleton_id));