diff options
| author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-06-17 23:51:41 +0000 |
|---|---|---|
| committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-06-17 23:51:41 +0000 |
| commit | 643bccac3c42470367cfc6f74d79f87837f4751e (patch) | |
| tree | 92b9bd20ba7b98a2679d24c1e3820120a4512fa0 /gcc/cp/class.c | |
| parent | b6c9bc9a430e91739692edc700df78122e6bfd4f (diff) | |
| download | ppe42-gcc-643bccac3c42470367cfc6f74d79f87837f4751e.tar.gz ppe42-gcc-643bccac3c42470367cfc6f74d79f87837f4751e.zip | |
* class.c (finish_struct): Make conflicting use of id a pedwarn.
* decl.c (pushdecl_class_level): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20552 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
| -rw-r--r-- | gcc/cp/class.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 56c29843458..0b3e2e02b85 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4300,7 +4300,9 @@ finish_struct (t, list_of_fieldlists, attributes, warn_anon) TREE_PROTECTED (DECL_RESULT (x)) = TREE_PROTECTED (x); } - /* Check for inconsistent use of this name in the class body. + /* A name N used in a class S shall refer to the same declaration + in its context and when re-evaluated in the completed scope of S. + Enums, types and static vars have already been checked. */ if (TREE_CODE (x) != TYPE_DECL && TREE_CODE (x) != USING_DECL && ! (TREE_CODE (x) == TEMPLATE_DECL @@ -4325,10 +4327,10 @@ finish_struct (t, list_of_fieldlists, attributes, warn_anon) && !(TREE_CODE (icv) == TYPE_DECL && DECL_CONTEXT (icv) == t)) { - cp_error_at ("declaration of identifier `%D' as `%+#D'", - name, x); - cp_error_at ("conflicts with other use in class as `%#D'", - icv); + cp_pedwarn_at ("declaration of identifier `%D' as `%+#D'", + name, x); + cp_pedwarn_at ("conflicts with other use in class as `%#D'", + icv); } } |

