Commit 2d9422b1 authored by jason's avatar jason
Browse files

* decl.c (grokdeclarator): Allow non-static data members with

        same name as class.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33827 138bc75d-0d04-0410-961f-82ee72b054a4
parent 3d997dc9
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,
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment