Commit Graph
6 Commits
Author SHA1 Message Date
Boaz Brickner 508a88e2a9 C++ inteop: Set type source info for a generated C++ thunk function (#6049)
This prevents a null pointer access crash when generating a thunk with
an automatically deduced trivial return type.
In this case, Clang calls `Sema::DeduceFunctionTypeFromReturnExpr()`
which calls `Sema::getReturnTypeLoc()`, which requires this information.

Part of #5514.
2025-09-12 07:11:36 +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