Files
carbon-lang/toolchain/check/cpp/access.h
T
Richard Smith 43867a678b Reverse interop support for type aliases. (#7043)
Allow any type that has a mapping from Carbon to C++ to be exposed to
C++ via name lookup. This also exposes the logic to export Carbon
classes to C++ to apply during type mapping, which gives very slight
support for passing Carbon types to C++ functions from Carbon, but not
really enough to sensibly test yet.

Depends on #7042.
2026-04-14 00:18:33 +00:00

23 lines
830 B
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef CARBON_TOOLCHAIN_CHECK_CPP_ACCESS_H_
#define CARBON_TOOLCHAIN_CHECK_CPP_ACCESS_H_
#include "toolchain/sem_ir/name_scope.h"
namespace Carbon::Check {
// Calculates the effective access kind from the given (declaration, lookup
// access) pair.
auto MapCppAccess(clang::DeclAccessPair access_pair) -> SemIR::AccessKind;
// Maps a Carbon access kind to a C++ access specifier, suitable for use when
// declaring a C++ class member with the same access. Never returns AS_none.
auto MapToCppAccess(SemIR::AccessKind access) -> clang::AccessSpecifier;
} // namespace Carbon::Check
#endif // CARBON_TOOLCHAIN_CHECK_CPP_ACCESS_H_