Skip to content

Headers generated from interfaces uses invalid C++ when exported name has dot #402

@jackwasey

Description

@jackwasey

The attributes vignette describes how to name a function using
// [[Rcpp:export(name="something.dot")]]
allowing use of . prefix or S3 methods. However, when
// [[Rcpp::interfaces(r, cpp)]]
is used, the generated header file uses the exported name (perhaps correctly), but when an S3 method is exported, the header includes things like:

    inline List rcpp.dot() {
      typedef SEXP(*Ptr_rcpp.dot)();

which don't compile.

To replicate:

Rcpp.package.skeleton()

Then change the attributes in src/rcpp_hello_world.cpp to:

// [[Rcpp::interfaces(r, cpp)]]
// [[Rcpp::export(name="rcpp.dot")]]

Then attempt to compile. I used devtools::load_all(). Without // [[Rcpp::interfaces(r, cpp)]] it compiles fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions