cxx icon indicating copy to clipboard operation
cxx copied to clipboard

"Expected identifier" even for C++ names

Open adetaylor opened this issue 3 years ago • 1 comments

Some Rust keywords are valid identifiers in C++. Yet this fails:

demo/include/blobstore.h: add

inline void move(uint32_t a) {}

demo/src/main.rs: add (in extern C++ section):

 #[cxx_name = "move"]
 fn move_(a: u32);

This gives

  error[cxxbridge]: expected identifier
     ┌─ src/main.rs:28:18
     │
  28 │                 #[cxx_name = "move"]
     │                              ^^^^^^ expected identifier

I haven't yet looked into how to fix this, but I may do so in due course.

adetaylor avatar May 23 '21 15:05 adetaylor

Same issue here with type.

NiceneNerd avatar Jul 23 '22 04:07 NiceneNerd