overload_resolution.h 1.3 KB

123456789101112131415161718192021222324252627282930
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef CARBON_TOOLCHAIN_CHECK_CPP_OVERLOAD_RESOLUTION_H_
  5. #define CARBON_TOOLCHAIN_CHECK_CPP_OVERLOAD_RESOLUTION_H_
  6. #include "toolchain/check/context.h"
  7. #include "toolchain/sem_ir/function.h"
  8. #include "toolchain/sem_ir/ids.h"
  9. namespace Carbon::Check {
  10. // Resolves which function to call using Clang overloading resolution, or
  11. // returns an error instruction if overload resolution failed.
  12. //
  13. // A set with a single non-templated function goes through the same rules for
  14. // overloading resolution. This is to make sure that calls that have no viable
  15. // implicit conversion sequence are rejected even when an implicit conversion is
  16. // possible. Keeping the same behavior here for consistency and supporting
  17. // migrations so that the migrated callers from C++ remain valid.
  18. auto PerformCppOverloadResolution(Context& context, SemIR::LocId loc_id,
  19. SemIR::CppOverloadSetId overload_set_id,
  20. SemIR::InstId self_id,
  21. llvm::ArrayRef<SemIR::InstId> arg_ids)
  22. -> SemIR::InstId;
  23. } // namespace Carbon::Check
  24. #endif // CARBON_TOOLCHAIN_CHECK_CPP_OVERLOAD_RESOLUTION_H_