diff options
author | Jason Merrill <jason@casey.cygnus.com> | 2000-05-10 17:48:30 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-05-10 13:48:30 -0400 |
commit | e54930f9a3cdfc6347ec4887bad203539501f846 (patch) | |
tree | cd7778fca45fa1e250d398dbbaeddf9e5d51db4e /gcc | |
parent | 0d12ea97198406563afcf4f7de411f702ca199ea (diff) | |
download | gcc-e54930f9a3cdfc6347ec4887bad203539501f846.zip gcc-e54930f9a3cdfc6347ec4887bad203539501f846.tar.gz gcc-e54930f9a3cdfc6347ec4887bad203539501f846.tar.bz2 |
decl.c (grokdeclarator): Allow non-static data members with same name as class.
* decl.c (grokdeclarator): Allow non-static data members with
same name as class.
From-SVN: r33827
Diffstat (limited to 'gcc')
-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) |