Rename and rearrange entities in tests to avoid name reuse (#7656)

Fix a bunch of cases where we use the same external name to mean
multiple different things in the same test. We've historically gotten
away with this, but under `--share-cpp-ast`, it becomes an error, at
least if the entity is either defined in, or used from, C++ code.

Assisted-by: Gemini via Antigravity (original change) and Claude Code
(suggested edits in review)

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
Richard Smith
2026-08-21 01:36:40 +00:00
committed by GitHub
co-authored by Chandler Carruth
parent 6eb900dff5
commit c588eadb57
53 changed files with 7794 additions and 7705 deletions
@@ -84,17 +84,17 @@ import Cpp;
alias r#Cpp = Cpp;
inline Cpp '''
void F();
void FRaw();
void G() {
void GRaw() {
// CHECK:STDERR: fail_carbon_raw_cpp.carbon:[[@LINE+8]]:16: error: semantics TODO: `interop with translation unit decl` [SemanticsTodo]
// CHECK:STDERR: Carbon::Cpp::F();
// CHECK:STDERR: Carbon::Cpp::FRaw();
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_carbon_raw_cpp.carbon:[[@LINE+4]]:11: error: no member named 'Cpp' in namespace 'Carbon' [CppInteropParseError]
// CHECK:STDERR: 19 | Carbon::Cpp::F();
// CHECK:STDERR: 19 | Carbon::Cpp::FRaw();
// CHECK:STDERR: | ~~~~~~~~^
// CHECK:STDERR:
Carbon::Cpp::F();
Carbon::Cpp::FRaw();
}
''';