Only check g++ version if we actually use g++