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


80. Class members with same name as class

Section: 11.4  [class.mem]     Status: TC1     Submitter: Jason Merrill     Date: 5 Dec 1998

Between the May '96 and September '96 working papers, the text in 11.4 [class.mem] paragraph 13:

If T is the name of a class, then each of the following shall have a name different from T:
was changed by removing the word 'static'. Looking over the meeting minutes from Stockholm, none of the proposals seem to include this change, which breaks C compatibility and is not mentioned in the compatibility annex. Was this change actually voted in by the committee?

Specifically, this breaks /usr/include/netinet/in.h under Linux, in which "struct ip_opts" shares its name with one of its members.

Proposed resolution (10/00):

  1. Change the first bullet of 11.4 [class.mem] paragraph 13 to say
  2. Add another paragraph before 11.4 [class.mem] paragraph 14, reading
    In addition, if class T has a user-declared constructor (11.4.5 [class.ctor] ), every nonstatic data member of class T shall have a name different from T.