Created on 2012-03-05.00:00:00 last changed 131 months ago
[Moved to DR at the April, 2013 meeting.]
Proposed resolution (October, 2012):
Change 12.6 [over.literal] as follows:
Change 12.6 [over.literal] paragraph 1 as follows:
The string-literal or user-defined-string-literal in a literal-operator-id shall have no encoding-prefix and shall contain no characters other than the implicit terminating '\0'. The ud-suffix of the user-defined-string-literal or the identifier in a literal-operator-id is called a literal suffix identifier. [Note: some literal suffix identifiers are reserved for future standardization; see 16.4.5.3.6 [usrlit.suffix]. —end note]
Change the example in 12.6 [over.literal] paragraph 8 as follows:
void operator "" _km(long double); // OK string operator "" _i18n(const char*, std::size_t); // OK template <char...> int operator "" \u03C0(); // OK: UCN for lowercase pi float operator ""E(const char*); //error: ""E (with no intervening space) // is a single tokenOK float operator " " B(const char*); // error: non-adjacent quotesempty string-literal string operator "" 5X(const char*, std::size_t); // error: invalid literal suffix identifier double operator "" _miles(double); // error: invalid parameter-declaration-clause template <char...> int operator "" _j(const char*); // error: invalid parameter-declaration-clause
The current grammar requires that there be no whitespace between the literal and the ud-suffix, e.g., ""_abc, but that there be whitespace between the "" and the identifier in a literal-operator-id, e.g., operator "" _abc. This seems unfortunate. Would it be possible to provide an alternate production,
with the requirement that the string-literal be empty?
The current wording is also unclear regarding interactions with phases of translation. We have the following production:
As this is after translation phase 6, would something like
operator "" "" _foo
be accepted?
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-03-03 00:00:00 | admin | set | status: drwp -> cd3 |
2013-10-14 00:00:00 | admin | set | status: dr -> drwp |
2013-05-03 00:00:00 | admin | set | messages: + msg4423 |
2013-05-03 00:00:00 | admin | set | status: tentatively ready -> dr |
2012-11-03 00:00:00 | admin | set | messages: + msg4078 |
2012-11-03 00:00:00 | admin | set | status: open -> tentatively ready |
2012-03-05 00:00:00 | admin | create |