Move imported C++ entities to the import block (#5616)

This mirrors how imports work in general, that the imported declarations
shouldn't belong to the first referencing scope (particularly apparent
when referenced across multiple scopes). I think this was just an
oversight here.
This commit is contained in:
Jon Ross-Perkins
2025-06-05 18:44:27 +00:00
committed by GitHub
parent 51b4abec20
commit 9b1a0729a1
11 changed files with 280 additions and 277 deletions
@@ -433,10 +433,11 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
// CHECK:STDOUT: .S = @F.%S.decl
// CHECK:STDOUT: .S = %S.decl
// CHECK:STDOUT: .foo = <error>
// CHECK:STDOUT: import Cpp//...
// CHECK:STDOUT: }
// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F(%s.param: %ptr) {