Diagnostics ported to c++