| Summary: | rust/ast/rust-fmt.h: templates through extern "C" linkage ? | ||
|---|---|---|---|
| Product: | gcc | Reporter: | David Binderman <dcb314> |
| Component: | rust | Assignee: | Not yet assigned to anyone <unassigned> |
| Status: | UNCONFIRMED --- | ||
| Severity: | normal | CC: | dkm, gcc-rust, pep |
| Priority: | P3 | ||
| Version: | 16.0 | ||
| Target Milestone: | --- | ||
| See Also: | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125823 | ||
| Host: | Target: | ||
| Build: | Known to work: | ||
| Known to fail: | Last reconfirmed: | ||
// TODO: Should we instead make an FFIVector struct? type PieceVec<'a> = ffi::FFIVec<ffi::Piece<'a>>; |
A compile of rust trunk with clang produces the following: trunk/gcc/rust/ast/rust-fmt.h:403:15: warning: 'clone_pieces' has C-linkage specified, but returns incomplete type 'FFIVec<Piece>' which could be incompatible with C [-Wreturn-type-c-linkage] trunk/gcc/rust/ast/rust-fmt.h:406:15: warning: 'clone_pieces' has C-linkage specified, but returns incomplete type 'FFIVec<Piece>' which could be incompatible with C [-Wreturn-type-c-linkage] Source code is extern "C" { FFIVec<Piece> collect_pieces (RustHamster input, bool append_newline, ParseMode parse_mode); FFIVec<Piece> clone_pieces (const FFIVec<Piece> &); } // extern "C" I don't think C understands C++ templates. Suggest code rework.