Skip to content

C++ interop: Mapping Carbon struct literals to a C++ type #5916

@ivanaivanovska

Description

@ivanaivanovska

Summary of issue:

When a C++ function is called from Carbon as Cpp.foo({}), the struct literal {} shall be mapped to a C++ type so that Clang can perform an overloading resolution.

What would be a suitable mapping for this case? We discussed translating it to a braced-init-list initializer (InitListExpr). Are there any concerns with that approach? Or an alternative that may be more suitable?

Details:

This question popped up when implementing support for overloaded C++ functions (PR #5891). Many existing tests use Carbon struct literals in the calls of the C++ functions (e.g. {}, {.a =2}).

Any other information that you want to share?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    leads questionA question for the leads team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions