On Mon, 28 Sept 2026 at 17:09, Corentin Jabot via SG16 <sg16@lists.isocpp.org> wrote:
On Mon, Sep 28, 2026, 23:01 Tom Honermann <tom@honermann.net> wrote:
On 9/28/26 4:04 AM, Corentin Jabot wrote:
EBCDIC-derived encodings use trigraphs and we should keep accepting the magical phase one mapping of trigraphs to be a conforming extension.

I don't think trigraphs can ever be a conforming extension. The following example has well-defined behavior in ISO C++, but behaves differently when trigraphs are enabled. https://godbolt.org/z/o3xznsrGY.

The model is that we can magically map the trigraphs that would appear outside of string literal in later phases. Which is even implementable given the fact no one actually implement distinct phases. It's a reasonable-ish justification to support trigraphs without warnings.

Would it be a conforming extension to declare an implementation-defined input encoding where e.g. the sequence '??!' happens to be the encoding for '|'? And similarly '%:' for '#' etc? It'd be an encoding with some very strange properties (in particular, needing lookahead!) but it might give the needed license where vendors need to support it. (The flaw that comes to mind for me is that the trigraph sequences become difficult to spell, but more indirection might overcome that: the encoding for '??!' in a string -- which I'm assuming is the only place it would be observable in a valid C++ program? -- could be encoded as the sequence ??""! ).