mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 08:00:13 +01:00
This shows that `inline` is ignored and the function definition is not
generated.
Demo:
```c++
// hello_world.h
inline void hello_world() {}
```
```carbon
// main.carbon
library "Main";
import Cpp library "hello_world.h";
fn Run() -> i32 {
Cpp.hello_world();
return 0;
}
```
```shell
$ bazel-bin/toolchain/carbon compile main.carbon
$ bazel-bin/toolchain/carbon link main.o --output=demo
ld.lld: error: undefined symbol: hello_world()
>>> referenced by main.carbon:8
>>> main.o:(main)
error: linker command failed with exit code 1 (use -v to see invocation)
```
Part of #5405.