From ae9abe615e45f4bf17fddb83e2057897a140b8e6 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 8 Jul 2026 13:33:16 -0400 Subject: [PATCH] Fix ImportCppType doc (#7476) Fixup for #6474. The previous doc was accidentally copied from ImportCppFunctionDecl. --- toolchain/check/cpp/import.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/toolchain/check/cpp/import.h b/toolchain/check/cpp/import.h index 951ed22dac5c..224ddd1c9c88 100644 --- a/toolchain/check/cpp/import.h +++ b/toolchain/check/cpp/import.h @@ -79,10 +79,14 @@ inline auto ImportCppFunctionDecl(Context& context, SemIR::LocId loc_id, SemIR::ClangDeclKey::ForFunctionDecl(clang_decl, signature_id)); } -// Imports a function declaration from Clang to Carbon. If successful, returns -// the new Carbon function declaration `InstId`. If the declaration was already -// imported, returns the mapped instruction. All unimported dependencies are -// imported first. +// Imports a type from Clang to Carbon. Returns a `TypeExpr` which contains +// both a `TypeId` and `TypeInstId`. All unimported dependencies are imported +// first. +// +// If a failure is diagnosed, the `TypeId` will be `ErrorInst::TypeId` and +// the `TypeInstId` will be `ErrorInst::InstId`. Types that are not yet +// supported may instead return `TypeId::None` and `TypeInstId::None`. +// Callers should handle both cases. auto ImportCppType(Context& context, SemIR::LocId loc_id, clang::QualType type) -> TypeExpr;