Fix PR2120 by changing the replacement order to change compile_cxx