Closed DavisVaughan closed 5 years ago
That looks like a compiler bug to me since make_xshared
is not a data member.
I wonder if there is a parsing error and if it is considered a member at this point of the compilation. Can you try disambiguating it with an inline
statement?
so you want me to do friend inline auto make_xshared<D>(xexpression<D>&&);
?
yep.
g++ -std=c++14 -I"/opt/R/3.6.0/lib64/R/include" -DNDEBUG -I"/home/davis/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -I/usr/local/include -I../inst/include -c RcppExports.cpp -o RcppExports.o
In file included from ../inst/include/xtensor/xaccumulator.hpp:17:0,
from ../inst/include/xtensor/xmath.hpp:25,
from ../inst/include/xtensor/xcontainer.hpp:23,
from ../inst/include/xtensor-r/rcontainer.hpp:17,
from ../inst/include/xtensor.h:1,
from RcppExports.cpp:4:
../inst/include/xtensor/xexpression.hpp:76:60: error: non-static data member declared ‘auto’
friend inline auto make_xshared<D>(xexpression<D>&&);
^
same issue
and replacing auto
with xshared_expression<E>
?
D
? I assume, not E
?
yep
This worked, I was able to compile the xtensor R package and rray https://github.com/QuantStack/xtensor/compare/master...DavisVaughan:inline-xshared
Great! So even though it is clearly a compiler bug, I think it is worth adding the return type in xtensor.
I've tried to install both the dev and CRAN versions of xtensor on a cloud based Linux machine we have that runs RStudio. It has
gcc 4.9.2
so I thought all would be well, but I get this message when trying to install. Any ideas? Googling doesn't get me much besides this:https://stackoverflow.com/questions/11302981/c11-declaring-non-static-data-members-as-auto