Fix pure cpp1 header file generated using -import-std
I've noticed that if I execute cppfront.exe with the -import-std option on a .h file that doesn't contain any cpp2 code, then an #endif will be missing at the end of the file. See https://github.com/hsutter/cppfront/issues/1320 for more info.
⚠️ I haven't added any test because I didn't see any tests with .h files.
A source without Cpp2 should be pass-through (i.e., the Cpp2 source and the generated Cpp1 source should compare equal). So you shouldn't need to print anything extra. The bug must be elsewhere.
Consider if that final #endif in the pure-Cpp1 Cpp2 source file actually had a space in front:
#endif
This solution would omit that space, and the resulting Cpp1 source wouldn't be pass-through. I imagine something similar might occur with regards to an ending newline (or maybe your original reproducer doesn't have it, which is what triggers the bug).
A source without Cpp2 should be pass-through (i.e., the Cpp2 source and the generated Cpp1 source should compare equal).
Unless you specify the flag to either import or include the standard library, then it adds extra stuff. https://github.com/hsutter/cppfront/blob/68b716abe3e4b623e875d68a2b9b3f0efcd39b45/source/to_cpp1.h#L1298-L1305
Thanks for your pull request! It looks like this may be your first contribution to cppfront. I've emailed you the Contributor License Agreement (CLA), and once it's completed I can look at your pull request. Thanks again for your contribution.