bytecodealliance / bytecodealliance/wit-bindgen
cpp: missing `<span>` include for `list<T>` parameters
Open
gen-cpp
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 286
- Avg merge
- 6h 32m
- Merged PRs (30d)
- 19
Description
When a WIT world imports a function that takes a `list` parameter, `wit-bindgen-cpp` generates C++ that uses `std::span<...>` in the public header but does not include ``. The generated bindings are not self-contained and fail to compile.
poc.wit
```
package poc:cpp-span;
world w {
import foo: func(x: list);
}
```
Steps:
1) Generate C++ bindings
2) Compile to see the error: `clang++ -c out/w.cpp -Iout -o out/w.o`
Actual result:
```
error: no member named 'span' in namespace 'std'
```
wit-bindgen version: 0.50.0
OS: Ubuntu 22.04.5 LTS (x86_64)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.