Test g++ compiler only if c++ is enabled.