To clear things up future:
Set a proper extension an it will work. At the moment your file doesn't have extension.
As your image shows the save dialog lists 3 extensions for cpp files (.cpp, .cc, .cxx). The save dialog does not know what extension you want, so you have to append your choose by entering the name "test2.cxx" or "test2.cpp" or whatever...