Dealing with Catalina

@kevinushey I am using someone else’s Mac that has Catalina and I can confirm that previously loading another package with compiled C++ code (such as readr) is sufficient to cause

library(readr) # or another package with compiled C++

Rcpp::sourceCpp(code = 
'
#include <Rcpp.h>
using namespace Rcpp; 

// [[Rcpp::export]]
int throw_exception() { 
  std::stringstream errmsg; errmsg << "this is an exception";
  throw std::domain_error(errmsg.str()); 
  return 0;
}
'
)

throw_exception()

to say

Error in thow_exception(): c++ exception (unknown reason)

instead of

Error in thow_exception(): this is an exception

However, if I don’t load any packages containing C++ previously, then I get the expected behavior. Is this a known issue? It doesn’t have anything directly to do with rstan code, but it may have a clue as to why we are having similar problems with dynamically loaded objects with C++ code generated by rstan.

This is using /usr/local/clang7/bin/clang++ and the ~/.R/Makevars file created by @coatless installer.