Commit Graph
7 Commits
Author SHA1 Message Date
Boaz Brickner a269c72e48 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.
2025-07-24 19:40:19 +00:00
Richard Smith f204bdf094 Basic support for calling class methods imported from C++. (#5796)
Create a `self` parameter when importing a C++ non-static member
function. That seems to be all we need to get basic method calls
working! For now, `const` methods have by-value self parameters, and
non-`const` methods get an `addr self: Self*` parameter.
2025-07-15 16:05:01 +00:00
Dana JansensandJon Ross-Perkins 76cdbd8a5a Introduce the none.carbon min-prelude (#5694)
The none.carbon min-prelude is not just an empty prelude, it also
prevents any prelude from being imported at all. So no import machinery
runs before the test, only the `package` statement from the prelude
would run.

Use the none.carbon min-prelude in a few tests that were specifying
`--no-prelude-import` to give it a trial run.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2025-06-18 20:45:46 +00:00
Jon Ross-Perkins 122800881b Remove redundant ranges=only flag settings (#5648) 2025-06-11 16:47:40 +00:00
Boaz Brickner 29d4aae722 Update most toolchain/check/testdata/interop/cpp tests to use sem ir ranges (#5594)
All except
`toolchain/check/testdata/interop/cpp/function_param_int*.carbon` and
`toolchain/check/testdata/interop/cpp/function_return.carbon`.

Don't output SemIR for cases that are intended to fail.
2025-06-11 12:35:55 +00:00
Jon Ross-Perkins 9b1a0729a1 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.
2025-06-05 18:44:27 +00:00
Jon Ross-Perkins 04d534abee Remove the no_prelude directory, using --no-prelude-import directly (#5607)
People seemed receptive [on
#toolchain](https://discord.com/channels/655572317891461132/655578254970716160/1379196447827689553),
so proceeding.

For the two name conflicts, I've set it up so that there's a
"foo.carbon" and "foo_with_prelude.carbon", to indicate that the
no-prelude approach is preferred (with a shorter name).

Note min_prelude will require a little more work/thought, I want to
avoid adding `--custom-core` etc.
2025-06-04 16:56:03 +00:00