Title
Multicharacter user-defined character literals
Status
drafting
Section
5.13.9 [lex.ext]
Submitter
Mike Miller

Created on 2013-07-31.00:00:00 last changed 136 months ago

Messages

Date: 2013-07-31.00:00:00

According to 5.13.3 [lex.ccon] paragraph 1, a multicharacter literal like 'ab' is conditionally-supported and has type int.

According to 5.13.9 [lex.ext] paragraph 6,

If L is a user-defined-character-literal, let ch be the literal without its ud-suffix. S shall contain a literal operator (12.6 [over.literal]) whose only parameter has the type of ch and the literal L is treated as a call of the form

    operator "" X(ch)

A user-defined-character-literal like 'ab'_foo would thus require a literal operator

    operator "" _foo(int)

However, that is not one of the signatures permitted by 12.6 [over.literal] paragraph 3.

Should multicharacter user-defined-character-literals be conditionally-supported? If so, 12.6 [over.literal] paragraph 3 should be adjusted accordingly. If not, a note in 5.13.9 [lex.ext] paragraph 6 saying explicitly that they are not supported would be helpful.

History
Date User Action Args
2013-10-14 00:00:00adminsetstatus: open -> drafting
2013-07-31 00:00:00admincreate