From a269c72e4894fef1cbca1c44ad9b773abc03c6e8 Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Thu, 24 Jul 2025 21:40:19 +0200 Subject: [PATCH] Fix variadic arguments test to use the format that is not deprecated in C++26 and fix the call site to be valid (#5842) See https://en.cppreference.com/w/cpp/language/variadic_arguments.html. Part of #5436. --- .../testdata/interop/cpp/function/function.carbon | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/toolchain/check/testdata/interop/cpp/function/function.carbon b/toolchain/check/testdata/interop/cpp/function/function.carbon index f27d49638d73..928acd7c2d80 100644 --- a/toolchain/check/testdata/interop/cpp/function/function.carbon +++ b/toolchain/check/testdata/interop/cpp/function/function.carbon @@ -107,12 +107,12 @@ fn F() { } // ============================================================================ -// Variadic +// Variadic arguments // ============================================================================ // --- variadic.h -auto foo(int...) -> void; +auto foo(int x, ...) -> void; // --- fail_todo_import_variadic.carbon @@ -123,13 +123,13 @@ import Cpp library "variadic.h"; fn F() { //@dump-sem-ir-begin // CHECK:STDERR: fail_todo_import_variadic.carbon:[[@LINE+7]]:3: error: semantics TODO: `Unsupported: Variadic function` [SemanticsTodo] - // CHECK:STDERR: Cpp.foo(); + // CHECK:STDERR: Cpp.foo(8); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fail_todo_import_variadic.carbon:[[@LINE+4]]:3: note: in `Cpp` name lookup for `foo` [InCppNameLookup] - // CHECK:STDERR: Cpp.foo(); + // CHECK:STDERR: Cpp.foo(8); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - Cpp.foo(); + Cpp.foo(8); //@dump-sem-ir-end } @@ -232,6 +232,7 @@ fn F() { // CHECK:STDOUT: --- fail_todo_import_variadic.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -245,6 +246,7 @@ fn F() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %foo.ref: = name_ref foo, [concrete = ] +// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8] // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: