From e8d95fdc2b9c6130544b04b13ffb303b0e611c42 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 10 Jul 2003 09:02:06 +0000 Subject: cp: PR c++ 9483 * class.c (check_field_decls): Pass DECL_NAME to constructor_name_p. * decl2.c (constructor_name_p): Avoid repeated constructor_name calls. * decl.c (grokdeclarator): Refactor ctor/dtor detection. testsuite: PR c++ 9483 * g++.dg/other/field1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69180 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cp/class.c') diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 5c276a4a3d0..bac2e0974a2 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -3177,7 +3177,7 @@ check_field_decls (tree t, tree *access_decls, /* Core issue 80: A nonstatic data member is required to have a different name from the class iff the class has a user-defined constructor. */ - if (constructor_name_p (x, t) && TYPE_HAS_CONSTRUCTOR (t)) + if (constructor_name_p (DECL_NAME (x), t) && TYPE_HAS_CONSTRUCTOR (t)) cp_pedwarn_at ("field `%#D' with same name as class", x); /* We set DECL_C_BIT_FIELD in grokbitfield. -- cgit v1.2.1