Files
carbon-lang/toolchain/check/cpp/location.h
T
Richard SmithandJon Ross-Perkins 925250f8f9 Improve diagnostics for overload resolution failure. (#6091)
Include notes listing the candidates and explaining why they didn't
work. Rather than duplicating the (substantial) logic for this, use the
Clang machinery to generate these diagnostics.

In order to support this, add a mechanism to map `SemIR::LocId`s to
`clang::SourceLocation`s. This works by creating source buffers in Clang
that refer into the Carbon source file so that `SourceLocation`s can
point into them.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2025-09-19 20:22:47 +00:00

20 lines
633 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_LOCATION_H_
#define CARBON_TOOLCHAIN_CHECK_CPP_LOCATION_H_
#include "toolchain/check/context.h"
#include "toolchain/sem_ir/ids.h"
namespace Carbon::Check {
// Maps a Carbon source location into an equivalent Clang source location.
auto GetCppLocation(Context& context, SemIR::LocId loc_id)
-> clang::SourceLocation;
} // namespace Carbon::Check
#endif // CARBON_TOOLCHAIN_CHECK_CPP_LOCATION_H_