diff options
| -rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bd7f0ea..ad66b8d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-05-10 Jason Merrill <jason@casey.cygnus.com> + + * decl.c (grokdeclarator): Allow non-static data members with + same name as class. + 2000-05-09 Zack Weinberg <zack@wolery.cumb.org> * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b951773..e32f243 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11393,11 +11393,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) /* 9.2p13 [class.mem] */ if (declarator == constructor_name (current_class_type) - /* Divergence from the standard: In extern "C", we - allow non-static data members here, because C does - and /usr/include/netinet/in.h uses that. */ - && (staticp || ! in_system_header)) - cp_pedwarn ("ISO C++ forbids data member `%D' with same name as enclosing class", + /* The standard does not allow non-static data members + here either, but we agreed at the 10/99 meeting + to change that in TC 1 so that they are allowed in + classes with no user-defined constructors. */ + && staticp) + cp_pedwarn ("ISO C++ forbids static data member `%D' with same name as enclosing class", declarator); if (staticp) |
