-
Notifications
You must be signed in to change notification settings - Fork 256
Open
Labels
gen-cppRelated to the C++ code generatorRelated to the C++ code generator
Description
When a WIT world imports a function that takes a list<T> parameter, wit-bindgen-cpp generates C++ that uses std::span<...> in the public header but does not include <span>. The generated bindings are not self-contained and fail to compile.
poc.wit
package poc:cpp-span;
world w {
import foo: func(x: list<u8>);
}
Steps:
- Generate C++ bindings
- 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)
Metadata
Metadata
Assignees
Labels
gen-cppRelated to the C++ code generatorRelated to the C++ code generator