Title
Class members with same name as class
Status
tc1
Section
11.4 [class.mem]
Submitter
Jason Merrill

Created on 1998-12-05.00:00:00 last changed 262 months ago

Messages

Date: 1999-10-15.00:00:00

Proposed resolution (10/00):

  1. Change the first bullet of 11.4 [class.mem] paragraph 13 to say
    • every static data member of class T;
  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.
Date: 2022-11-20.07:54:16

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:
  • every static data member of class 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
    • every static data member of class T;
  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.
History
Date User Action Args
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-11-18 00:00:00adminsetstatus: ready -> dr
2000-05-21 00:00:00adminsetstatus: review -> ready
2000-02-23 00:00:00adminsetmessages: + msg226
2000-02-23 00:00:00adminsetstatus: open -> review
1998-12-05 00:00:00admincreate