At least C++ compilation is turing complete so it is possible/easy to produce infinite loop impacting system performance and producing infinite output (exhausting ram and/or disk place).
More info on how C++ compilation is turing complete : http://stackoverflow.com/questions/189172/c-templates-turing-completehttps://stackoverflow.com/questions/189172/c-templates-turing-complete