[Bug c++/33677] Member with same name as class is not rejected

2009-01-02 Thread s__nakayama at infoseek dot jp


--- Comment #6 from s__nakayama at infoseek dot jp  2009-01-02 14:52 ---
 If T is the name of a class, then each of the following shall have a name 
 different from T:
 - every data member of class T;

This description is the one in ISO/IEC 14882:1998. 
It was changed in ISO/IEC 14882:2003 as follows.

 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;

http://www.open-std.org/jtc1/sc22/wg21/docs/core5.htm#80


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33677



[Bug c++/33677] Member with same name as class

2008-12-31 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2009-01-01 04:10 ---
Because it changes the meaning of foo inside the struct.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33677



[Bug c++/33677] Member with same name as class

2008-12-31 Thread pinskia at gcc dot gnu dot org


--- Comment #4 from pinskia at gcc dot gnu dot org  2009-01-01 04:18 ---
If T is the name of a class, then each of the following shall have a name
different from T:
— every data member of class T;

The way I read is that foo cannot be the name of the data member of class foo.

Hmm, maybe there was a defect report about this ...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33677



[Bug c++/33677] Member with same name as class is not rejected

2008-12-31 Thread pinskia at gcc dot gnu dot org


--- Comment #5 from pinskia at gcc dot gnu dot org  2009-01-01 04:20 ---
So confirmed as being invalid code at least the way I read the standard.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||accepts-invalid
   Last reconfirmed|-00-00 00:00:00 |2009-01-01 04:20:39
   date||
Summary|Member with same name as|Member with same name as
   |class   |class is not rejected


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33677



[Bug c++/33677] Member with same name as class

2007-10-11 Thread s__nakayama at infoseek dot jp


--- Comment #2 from s__nakayama at infoseek dot jp  2007-10-11 13:50 ---
(In reply to comment #1)
 This code is invalid, and we should reject both of them.

Why do you think that this is invalid?
Member with same name as class have restrictions(ISO/IEC 14882:2003 9.2
p13/13a).
But, I can not find the restriction that this is invalid.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33677



[Bug c++/33677] Member with same name as class

2007-10-09 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2007-10-09 22:22 ---
This code is invalid, and we should reject both of them.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33677