https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122888
Bug ID: 122888
Summary: rust/ast/rust-fmt.h: templates through extern "C"
linkage ?
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rust
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
CC: dkm at gcc dot gnu.org, gcc-rust at gcc dot gnu.org,
pierre-emmanuel.patry at embecosm dot com
Target Milestone: ---
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.
--
You are receiving this mail because:
You are on the CC list for the bug.