This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2023-01-15


1762. Reserved identifier used in literal-operator-id example

Section: 12.6  [over.literal]     Status: C++14     Submitter: Switzerland     Date: 2013-09-23

N3690 comment CH 6

[Moved to DR at the February, 2014 meeting.]

The example in 12.6 [over.literal] paragraph 8 contains the line

  float operator ""E(const char*); // OK

E does not begin with an underscore and thus is a reserved name.

Proposed resolution (September, 2013):

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...> double operator "" _\u03C0();       // OK: UCN for lowercase pi
  float operator ""_E(const char*);                      // OK
  float operator ""E(const char*);                       // error: reserved identifier
  float operator " " B(const char*);                     // error: non-empty 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

Rationale (February, 2014):

The specification was removed from the WP and moved into a Technical Specification.