Skip to content

Commit e575ff8

Browse files
committed
Improve diagnostics for overload resolution failure.
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.
1 parent cac3578 commit e575ff8

19 files changed

+368
-292
lines changed

toolchain/check/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ cc_library(
2323
"convert.cpp",
2424
"cpp/custom_type_mapping.cpp",
2525
"cpp/import.cpp",
26+
"cpp/location.cpp",
2627
"cpp/overload_resolution.cpp",
2728
"cpp/thunk.cpp",
2829
"cpp/type_mapping.cpp",
@@ -72,6 +73,7 @@ cc_library(
7273
"convert.h",
7374
"cpp/custom_type_mapping.h",
7475
"cpp/import.h",
76+
"cpp/location.h",
7577
"cpp/overload_resolution.h",
7678
"cpp/thunk.h",
7779
"cpp/type_mapping.h",
@@ -146,6 +148,7 @@ cc_library(
146148
"//toolchain/lex:tokenized_buffer",
147149
"//toolchain/parse:node_kind",
148150
"//toolchain/parse:tree",
151+
"//toolchain/sem_ir:absolute_node_id",
149152
"//toolchain/sem_ir:clang_decl",
150153
"//toolchain/sem_ir:expr_info",
151154
"//toolchain/sem_ir:file",

toolchain/check/cpp/import.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,13 @@ auto ImportCppFunctionDecl(Context& context, SemIR::LocId loc_id,
16941694

16951695
SemIR::Function& function_info = context.functions().Get(*function_id);
16961696
if (IsCppThunkRequired(context, function_info)) {
1697+
Diagnostics::AnnotationScope annotate_diagnostics(
1698+
&context.emitter(), [&](auto& builder) {
1699+
CARBON_DIAGNOSTIC(InCppThunk, Note,
1700+
"in thunk for Cpp function used here");
1701+
builder.Note(loc_id, InCppThunk);
1702+
});
1703+
16971704
clang::FunctionDecl* thunk_clang_decl =
16981705
BuildCppThunk(context, function_info);
16991706
if (thunk_clang_decl) {

toolchain/check/cpp/location.cpp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
5+
#include "toolchain/check/cpp/location.h"
6+
7+
#include "toolchain/sem_ir/absolute_node_id.h"
8+
#include "toolchain/sem_ir/ids.h"
9+
10+
namespace Carbon::Check {
11+
12+
static auto GetFile(Context& context, SemIR::CheckIRId ir_id)
13+
-> const SemIR::File* {
14+
if (ir_id == context.sem_ir().check_ir_id()) {
15+
// Common case: the IR is the current file.
16+
return &context.sem_ir();
17+
}
18+
19+
// If the file is imported, locate it in our imports map.
20+
auto import_id = context.check_ir_map().Get(ir_id);
21+
if (!import_id.has_value()) {
22+
// We never imported this CheckIR.
23+
// TODO: Can this happen?
24+
return nullptr;
25+
}
26+
return context.import_irs().Get(import_id).sem_ir;
27+
}
28+
29+
auto GetCppLocation(Context& context, SemIR::LocId loc_id)
30+
-> clang::SourceLocation {
31+
if (!context.sem_ir().clang_ast_unit()) {
32+
return clang::SourceLocation();
33+
}
34+
35+
// Break down the `LocId` into an import path. If that ends in a C++ location,
36+
// we can just return that directly.
37+
llvm::SmallVector<SemIR::AbsoluteNodeId> absolute_node_ids =
38+
SemIR::GetAbsoluteNodeId(&context.sem_ir(), loc_id);
39+
if (absolute_node_ids.back().check_ir_id() == SemIR::CheckIRId::Cpp) {
40+
return context.sem_ir().clang_source_locs().Get(
41+
absolute_node_ids.back().clang_source_loc_id());
42+
}
43+
44+
// This is a location in Carbon code; decompose it so we can map it into a
45+
// Clang location.
46+
// TODO: Consider recreating the complete import path instead of only the
47+
// final entry.
48+
auto absolute_node_id = absolute_node_ids.back();
49+
const auto* ir = GetFile(context, absolute_node_id.check_ir_id());
50+
if (!ir) {
51+
return clang::SourceLocation();
52+
}
53+
const auto& tree = ir->parse_tree();
54+
const auto& source = tree.tokens().source();
55+
auto offset =
56+
tree.tokens().GetByteOffset(tree.node_token(absolute_node_id.node_id()));
57+
58+
// Get or create a corresponding Clang file.
59+
// TODO: Consider caching a mapping from Carbon ImportIRIds to Clang
60+
// start-of-file SourceLocations.
61+
auto& src_mgr = context.ast_context().getSourceManager();
62+
auto file = src_mgr.getFileManager().getOptionalFileRef(source.filename());
63+
if (!file) {
64+
file = src_mgr.getFileManager().getVirtualFileRef(
65+
source.filename(), static_cast<off_t>(0), static_cast<time_t>(0));
66+
}
67+
src_mgr.overrideFileContents(
68+
*file, llvm::MemoryBufferRef(source.text(), source.filename()));
69+
70+
// Build a corresponding location.
71+
auto file_id = src_mgr.getOrCreateFileID(
72+
*file, clang::SrcMgr::CharacteristicKind::C_User);
73+
return src_mgr.getLocForStartOfFile(file_id).getLocWithOffset(offset);
74+
}
75+
76+
} // namespace Carbon::Check

toolchain/check/cpp/location.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
5+
#ifndef CARBON_TOOLCHAIN_CHECK_CPP_LOCATION_H_
6+
#define CARBON_TOOLCHAIN_CHECK_CPP_LOCATION_H_
7+
8+
#include "toolchain/check/context.h"
9+
#include "toolchain/sem_ir/ids.h"
10+
11+
namespace Carbon::Check {
12+
13+
// Maps a Carbon source location into an equivalent Clang source location.
14+
auto GetCppLocation(Context& context, SemIR::LocId loc_id)
15+
-> clang::SourceLocation;
16+
17+
} // namespace Carbon::Check
18+
19+
#endif // CARBON_TOOLCHAIN_CHECK_CPP_LOCATION_H_

toolchain/check/cpp/overload_resolution.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,27 @@
44

55
#include "toolchain/check/cpp/overload_resolution.h"
66

7+
#include "clang/Basic/DiagnosticSema.h"
78
#include "clang/Sema/Overload.h"
89
#include "clang/Sema/Sema.h"
910
#include "toolchain/check/cpp/import.h"
11+
#include "toolchain/check/cpp/location.h"
1012
#include "toolchain/check/cpp/type_mapping.h"
1113
#include "toolchain/sem_ir/expr_info.h"
1214
#include "toolchain/sem_ir/typed_insts.h"
1315

1416
namespace Carbon::Check {
1517

18+
// Map a Carbon name into a C++ name.
19+
static auto GetCppName(Context& context, SemIR::NameId name_id)
20+
-> clang::DeclarationName {
21+
// TODO: Some special names should probably use different formatting. In
22+
// particular, NameId::CppOperator should probably map back to a
23+
// CXXOperatorName.
24+
auto name_str = context.names().GetFormatted(name_id);
25+
return clang::DeclarationName(&context.ast_context().Idents.get(name_str));
26+
}
27+
1628
// Invents a Clang argument expression to use in overload resolution to
1729
// represent the given Carbon argument instruction.
1830
static auto InventClangArg(Context& context, SemIR::InstId arg_id)
@@ -60,9 +72,9 @@ static auto InventClangArg(Context& context, SemIR::InstId arg_id)
6072

6173
// TODO: Avoid heap allocating more of these on every call. Either cache them
6274
// somewhere or put them on the stack.
63-
return new (context.ast_context()) clang::OpaqueValueExpr(
64-
// TODO: Add location accordingly.
65-
clang::SourceLocation(), arg_cpp_type.getNonReferenceType(), value_kind);
75+
return new (context.ast_context())
76+
clang::OpaqueValueExpr(GetCppLocation(context, SemIR::LocId(arg_id)),
77+
arg_cpp_type.getNonReferenceType(), value_kind);
6678
}
6779

6880
// Adds the given overload candidates to the candidate set.
@@ -119,13 +131,6 @@ auto PerformCppOverloadResolution(Context& context, SemIR::LocId loc_id,
119131
SemIR::InstId self_id,
120132
llvm::ArrayRef<SemIR::InstId> arg_ids)
121133
-> SemIR::InstId {
122-
Diagnostics::AnnotationScope annotate_diagnostics(
123-
&context.emitter(), [&](auto& builder) {
124-
CARBON_DIAGNOSTIC(InCallToCppFunction, Note,
125-
"in call to Cpp function here");
126-
builder.Note(loc_id, InCallToCppFunction);
127-
});
128-
129134
// Map Carbon call argument types to C++ types.
130135
clang::Expr* self_expr = nullptr;
131136
if (self_id.has_value()) {
@@ -147,11 +152,11 @@ auto PerformCppOverloadResolution(Context& context, SemIR::LocId loc_id,
147152
const SemIR::CppOverloadSet& overload_set =
148153
context.cpp_overload_sets().Get(overload_set_id);
149154

155+
clang::SourceLocation loc = GetCppLocation(context, loc_id);
156+
150157
// Add candidate functions from the name lookup.
151158
clang::OverloadCandidateSet candidate_set(
152-
// TODO: Add location accordingly.
153-
clang::SourceLocation(),
154-
clang::OverloadCandidateSet::CandidateSetKind::CSK_Normal);
159+
loc, clang::OverloadCandidateSet::CandidateSetKind::CSK_Normal);
155160

156161
clang::ASTUnit* ast = context.sem_ir().clang_ast_unit();
157162
CARBON_CHECK(ast);
@@ -163,43 +168,38 @@ auto PerformCppOverloadResolution(Context& context, SemIR::LocId loc_id,
163168
// Find best viable function among the candidates.
164169
clang::OverloadCandidateSet::iterator best_viable_fn;
165170
clang::OverloadingResult overloading_result =
166-
// TODO: Add location accordingly.
167-
candidate_set.BestViableFunction(sema, clang::SourceLocation(),
168-
best_viable_fn);
171+
candidate_set.BestViableFunction(sema, loc, best_viable_fn);
169172

170173
switch (overloading_result) {
171174
case clang::OverloadingResult::OR_Success: {
172175
// TODO: Handle the cases when Function is null.
173176
CARBON_CHECK(best_viable_fn->Function);
174-
sema.MarkFunctionReferenced(clang::SourceLocation(),
175-
best_viable_fn->Function);
177+
sema.MarkFunctionReferenced(loc, best_viable_fn->Function);
176178
SemIR::InstId result =
177179
ImportCppFunctionDecl(context, loc_id, best_viable_fn->Function);
178180
return result;
179181
}
180182
case clang::OverloadingResult::OR_No_Viable_Function: {
181-
// TODO: Add notes with the candidates.
182-
CARBON_DIAGNOSTIC(CppOverloadingNoViableFunctionFound, Error,
183-
"no matching function for call to `{0}`",
184-
SemIR::NameId);
185-
context.emitter().Emit(loc_id, CppOverloadingNoViableFunctionFound,
186-
overload_set.name_id);
183+
candidate_set.NoteCandidates(
184+
clang::PartialDiagnosticAt(
185+
loc, sema.PDiag(clang::diag::err_ovl_no_viable_function_in_call)
186+
<< GetCppName(context, overload_set.name_id)),
187+
sema, clang::OCD_AllCandidates, arg_exprs);
187188
return SemIR::ErrorInst::InstId;
188189
}
189190
case clang::OverloadingResult::OR_Ambiguous: {
190-
// TODO: Add notes with the candidates.
191-
CARBON_DIAGNOSTIC(CppOverloadingAmbiguousCandidatesFound, Error,
192-
"call to `{0}` is ambiguous", SemIR::NameId);
193-
context.emitter().Emit(loc_id, CppOverloadingAmbiguousCandidatesFound,
194-
overload_set.name_id);
191+
candidate_set.NoteCandidates(
192+
clang::PartialDiagnosticAt(
193+
loc, sema.PDiag(clang::diag::err_ovl_ambiguous_call)
194+
<< GetCppName(context, overload_set.name_id)),
195+
sema, clang::OCD_AmbiguousCandidates, arg_exprs);
195196
return SemIR::ErrorInst::InstId;
196197
}
197198
case clang::OverloadingResult::OR_Deleted: {
198-
// TODO: Add notes with the candidates.
199-
CARBON_DIAGNOSTIC(CppOverloadingDeletedFunctionFound, Error,
200-
"call to deleted function `{0}`", SemIR::NameId);
201-
context.emitter().Emit(loc_id, CppOverloadingDeletedFunctionFound,
202-
overload_set.name_id);
199+
sema.DiagnoseUseOfDeletedFunction(
200+
loc, clang::SourceRange(loc, loc),
201+
GetCppName(context, overload_set.name_id), candidate_set,
202+
best_viable_fn->Function, arg_exprs);
203203
return SemIR::ErrorInst::InstId;
204204
}
205205
}

toolchain/check/testdata/interop/cpp/class/method.carbon

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -58,37 +58,29 @@ fn Value(v: Cpp.HasQualifiers) {
5858
v.plain();
5959

6060
// TODO: This should remain invalid once we support `volatile`.
61-
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+7]]:3: error: semantics TODO: `Unsupported: object parameter type: volatile struct HasQualifiers` [SemanticsTodo]
62-
// CHECK:STDERR: v.volatile_this();
63-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
64-
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
61+
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: object parameter type: volatile struct HasQualifiers` [SemanticsTodo]
6562
// CHECK:STDERR: v.volatile_this();
6663
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
6764
// CHECK:STDERR:
6865
v.volatile_this();
6966

70-
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+7]]:3: error: no matching function for call to `ref_this` [CppOverloadingNoViableFunctionFound]
71-
// CHECK:STDERR: v.ref_this();
72-
// CHECK:STDERR: ^~~~~~~~~~~~
73-
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
74-
// CHECK:STDERR: v.ref_this();
75-
// CHECK:STDERR: ^~~~~~~~~~~~
67+
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+8]]:14: error: no matching function for call to 'ref_this' [CppInteropParseError]
68+
// CHECK:STDERR: 29 | v.ref_this();
69+
// CHECK:STDERR: | ^
70+
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-20]]:10: in file included here [InCppInclude]
71+
// CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable: expects an lvalue for object argument [CppInteropParseNote]
72+
// CHECK:STDERR: 7 | void ref_this() &;
73+
// CHECK:STDERR: | ^
7674
// CHECK:STDERR:
7775
v.ref_this();
7876

79-
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+7]]:3: error: semantics TODO: `Unsupported: object parameter type: struct HasQualifiers &&` [SemanticsTodo]
80-
// CHECK:STDERR: v.ref_ref_this();
81-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
82-
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
77+
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: object parameter type: struct HasQualifiers &&` [SemanticsTodo]
8378
// CHECK:STDERR: v.ref_ref_this();
8479
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
8580
// CHECK:STDERR:
8681
v.ref_ref_this();
8782

88-
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+7]]:3: error: semantics TODO: `Unsupported: object parameter type: const struct HasQualifiers &&` [SemanticsTodo]
89-
// CHECK:STDERR: v.const_ref_ref_this();
90-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
91-
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
83+
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: object parameter type: const struct HasQualifiers &&` [SemanticsTodo]
9284
// CHECK:STDERR: v.const_ref_ref_this();
9385
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
9486
// CHECK:STDERR:
@@ -103,10 +95,7 @@ import Cpp library "object_param_qualifiers.h";
10395

10496
fn Ref(p: Cpp.HasQualifiers*) {
10597
// TODO: This should eventually be accepted if we support `volatile`.
106-
// CHECK:STDERR: fail_todo_bad_object_param_qualifiers_by_ref.carbon:[[@LINE+7]]:3: error: semantics TODO: `Unsupported: object parameter type: volatile struct HasQualifiers` [SemanticsTodo]
107-
// CHECK:STDERR: p->volatile_this();
108-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
109-
// CHECK:STDERR: fail_todo_bad_object_param_qualifiers_by_ref.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
98+
// CHECK:STDERR: fail_todo_bad_object_param_qualifiers_by_ref.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: object parameter type: volatile struct HasQualifiers` [SemanticsTodo]
11099
// CHECK:STDERR: p->volatile_this();
111100
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
112101
// CHECK:STDERR:
@@ -120,21 +109,23 @@ library "[[@TEST_NAME]]";
120109
import Cpp library "object_param_qualifiers.h";
121110

122111
fn Ref(p: Cpp.HasQualifiers*) {
123-
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+7]]:3: error: no matching function for call to `ref_ref_this` [CppOverloadingNoViableFunctionFound]
124-
// CHECK:STDERR: p->ref_ref_this();
125-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
126-
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
127-
// CHECK:STDERR: p->ref_ref_this();
128-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
112+
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+8]]:19: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
113+
// CHECK:STDERR: 15 | p->ref_ref_this();
114+
// CHECK:STDERR: | ^
115+
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
116+
// CHECK:STDERR: ./object_param_qualifiers.h:10:8: note: candidate function not viable: expects an rvalue for object argument [CppInteropParseNote]
117+
// CHECK:STDERR: 10 | void ref_ref_this() &&;
118+
// CHECK:STDERR: | ^
129119
// CHECK:STDERR:
130120
p->ref_ref_this();
131121

132-
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+7]]:3: error: no matching function for call to `const_ref_ref_this` [CppOverloadingNoViableFunctionFound]
133-
// CHECK:STDERR: p->const_ref_ref_this();
134-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
135-
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
136-
// CHECK:STDERR: p->const_ref_ref_this();
137-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
122+
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+8]]:25: error: no matching function for call to 'const_ref_ref_this' [CppInteropParseError]
123+
// CHECK:STDERR: 25 | p->const_ref_ref_this();
124+
// CHECK:STDERR: | ^
125+
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
126+
// CHECK:STDERR: ./object_param_qualifiers.h:11:8: note: candidate function not viable: expects an rvalue for object argument [CppInteropParseNote]
127+
// CHECK:STDERR: 11 | void const_ref_ref_this() const&&;
128+
// CHECK:STDERR: | ^
138129
// CHECK:STDERR:
139130
p->const_ref_ref_this();
140131
}

toolchain/check/testdata/interop/cpp/class/struct.carbon

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,7 @@ import Cpp library "dynamic.h";
177177

178178
//@dump-sem-ir-begin
179179
fn MyF(bar: Cpp.Bar*) {
180-
// CHECK:STDERR: fail_todo_call_dynamic.carbon:[[@LINE+7]]:3: error: semantics TODO: `Unsupported: Virtual function` [SemanticsTodo]
181-
// CHECK:STDERR: bar->f();
182-
// CHECK:STDERR: ^~~~~~~~
183-
// CHECK:STDERR: fail_todo_call_dynamic.carbon:[[@LINE+4]]:3: note: in call to Cpp function here [InCallToCppFunction]
180+
// CHECK:STDERR: fail_todo_call_dynamic.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: Virtual function` [SemanticsTodo]
184181
// CHECK:STDERR: bar->f();
185182
// CHECK:STDERR: ^~~~~~~~
186183
// CHECK:STDERR:
@@ -512,9 +509,9 @@ fn MyF(bar: Cpp.Bar*);
512509
// CHECK:STDOUT: fn @MyF(%bar.param: %ptr.f68) {
513510
// CHECK:STDOUT: !entry:
514511
// CHECK:STDOUT: %bar.ref: %ptr.f68 = name_ref bar, %bar
515-
// CHECK:STDOUT: %.loc15: ref %Bar = deref %bar.ref
512+
// CHECK:STDOUT: %.loc12: ref %Bar = deref %bar.ref
516513
// CHECK:STDOUT: %f.ref: %.2e2 = name_ref f, imports.%.6e0 [concrete = constants.%empty_struct]
517-
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc15, %f.ref
514+
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %.loc12, %f.ref
518515
// CHECK:STDOUT: return
519516
// CHECK:STDOUT: }
520517
// CHECK:STDOUT:

toolchain/check/testdata/interop/cpp/fail_todo_arithmetic_types_unmapped.carbon

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ fn CallGetUL() -> u64 { return Cpp.GetUL(); }
2929
// TODO: Eventually, `unsigned long long` should map to
3030
// `Cpp.unsigned_long_long`, which should implicitly convert to `u64`.
3131
// We should switch to testing a different type when that case works.
32-
// CHECK:STDERR: fail_todo_use_u64_types.carbon:[[@LINE+7]]:33: error: semantics TODO: `Unsupported: return type: unsigned long long` [SemanticsTodo]
33-
// CHECK:STDERR: fn CallGetULL() -> u64 { return Cpp.GetULL(); }
34-
// CHECK:STDERR: ^~~~~~~~~~~~
35-
// CHECK:STDERR: fail_todo_use_u64_types.carbon:[[@LINE+4]]:33: note: in call to Cpp function here [InCallToCppFunction]
32+
// CHECK:STDERR: fail_todo_use_u64_types.carbon:[[@LINE+4]]:33: error: semantics TODO: `Unsupported: return type: unsigned long long` [SemanticsTodo]
3633
// CHECK:STDERR: fn CallGetULL() -> u64 { return Cpp.GetULL(); }
3734
// CHECK:STDERR: ^~~~~~~~~~~~
3835
// CHECK:STDERR:

0 commit comments

Comments
 (0)