TIL that C++03 considered a file without a trailing newline to be undefined behaviour! https://stackoverflow.com/a/72377 This was fixed in C++11, but the problem was that #include was a textual operation that could produce invalid syntax if no newline was present.