[Rcpp-devel] LLVM

Conrad Sand conradsand.rcpp at gmail.com
Mon Jul 25 07:41:33 CEST 2011


I believe this is an issue in Clang, not Armadillo. There is another
problem with Clang: it tends to be overly picky, to the point of doing
implicit template instantiations (where no instantiation was
requested!).

The over-pickiness broke the static assertion approach used in
Armadillo, which works in GCC and even dodgy "compilers" like MSVC.
However, static assertions are not explicitly supported by C++98, and
their implementation in Armadillo (as well as other libraries like
Boost) are more along the lines of clever hacks than proper code.

To evade Clang's pickiness, I've modified the static assertion hack to
use an alternative technique.  This is implemented in Armadillo
2.1.91:
http://sourceforge.net/projects/arma/files/armadillo-2.1.91.tar.gz

Clang is still likely to spew a bazillion warnings (which are all
false positives), but at least it should now compile Armadillo based
code.


PS.
Once the new C++ standard becomes official (currently known as C++0x)
and there are enough C++ compilers that support it, Armadillo will use
new C++ features, such built-in support for static assertions.


On 24 July 2011 07:41, Jan de Leeuw <deleeuw at stat.ucla.edu> wrote:
>  Sure. If I switch to g++-4.7 (from FSF svn) it disappears. Also, I think, if I switch to Apple's g++-4.2.
> Only happens with g++-llvm and clang++. Of course I think LLVM still says C++ support is incomplete.
>
> --
> Jan de Leeuw
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


More information about the Rcpp-devel mailing list