https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58687
Neil Booth <neilb at protonmail dot ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |neilb at protonmail dot ch --- Comment #36 from Neil Booth <neilb at protonmail dot ch> --- I read the standard for #line differently to the submitter. It says: A preprocessing directive of the form # line digit-sequence new-line causes the implementation to behave as if the following sequence of source lines begins with a source line that has a line number as specified by the digit sequence The "following sequence of source lines" therefore begins after the new-line terminating the #line directive. Therefore #line __LINE__ as a simple one-liner actually causes a decrement in the line number of the line after #line compared to if the #line didn't exist, as it gets the line number of the #line line.