Just discovered that the Wave Driver (not sure about other setups) preprocesses the following code in a way that doesn't conform to the standard:
Is evaluated as 2, while the standard (at least from what I know, would love a source on this) says trigraphs aren't supposed to be evaluated after line splicing happens. Therefore, I believe the correct way to process the above snippet should be to convert ??/ to \, see there are no more trigraphs to convert, splice the first two lines into ??=define X 2, and then not to convert the ??= trigraph to a # because we've already spliced lines. Expected output is as follows: