Skip to content

CA-022 5.5p1 [lex.pptoken] Add example for ill-formed non-preprocessing tokens #596

@wg21bot

Description

@wg21bot

The restriction

If any character not in the basic character set matches the last category, the program is ill-formed.

can benefit from an illustrative example that it reserves space for future evolution of the language and for potential "conforming extensions".

For example (where <U+3000> represents U+3000 IDEOGRAPHIC SPACE):

# if 0
#<U+3000>else  // ill-formed, diagnostic required
int x;
# endif

can, with a diagnostic, be accepted as expanding to

int x;

via an extension that treats Unicode whitespace as C++ whitespace.

Proposed change:

Add the example or clearly document reaffirmation that the example code is ill-formed as a violation of the quoted diagnosable rule.

See also #595

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions