<div dir="ltr">The attached code throws an exception with a specific error message. However, this is what it looks like when I compile it on Sierra using the unofficial Clang 4.0.0 build from <a href="http://r.research.att.com/libs/">http://r.research.att.com/libs/</a><div><br></div><div>```{r}</div><div><div>Rcpp::sourceCpp('Dropbox/blog/RcppException.cpp')</div><div>throw_exception()</div></div><div>```</div><div>Error in throw_exception() : c++ exception (unknown reason)<br></div><div><br></div><div>This is my ~/.R/Makevars</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">CC  = /usr/local/clang4/bin/clang</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">CXX = /usr/local/clang4/bin/clang++ -arch x86_64 -ftemplate-depth-256<br></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">LDFLAGS=-L/usr/local/clang4/lib -fopenmp</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)">CXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -fopenmp<br></p></div><div><br></div><div>Note that this works as expected if I instead use the official Clang 4.0.0 binary from <a href="http://releases.llvm.org/download.html#4.0.0">http://releases.llvm.org/download.html#4.0.0</a></div><div><br></div><div><div>R version 3.4.1 (2017-06-30)</div><div>Platform: x86_64-apple-darwin15.6.0 (64-bit)</div><div>Running under: macOS Sierra 10.12.6</div><div><br></div><div>Matrix products: default</div><div>BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib</div><div>LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib</div><div><br></div><div>locale:</div><div>[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8</div><div><br></div><div>attached base packages:</div><div>[1] stats     graphics  grDevices utils     datasets  methods   base     </div><div><br></div><div>loaded via a namespace (and not attached):</div><div>[1] compiler_3.4.1 tools_3.4.1    Rcpp_0.12.12 </div></div></div>