re PR c++/18530 (Bogus warnings about shadowed variables __ct, __dt)

PR c++/18530
	* cp-tree.h (CTOR_NAME): Remove.
	(DTOR_NAME): Remove.
	* decl.c (initialize_predefined_identifiers): Add spaces to the
	end of constructor and destructor names.

	PR c++/18530
	* g++.dg/warn/Wshadow-3.C: New test.

From-SVN: r91179
This commit is contained in:
Mark Mitchell 2004-11-24 17:57:00 +00:00 committed by Mark Mitchell
parent 479ec1d1e0
commit d6eec20888
5 changed files with 30 additions and 9 deletions

View File

@ -1,3 +1,11 @@
2004-11-24 Mark Mitchell <mark@codesourcery.com>
PR c++/18530
* cp-tree.h (CTOR_NAME): Remove.
(DTOR_NAME): Remove.
* decl.c (initialize_predefined_identifiers): Add spaces to the
end of constructor and destructor names.
2004-11-24 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/8929

View File

@ -3162,8 +3162,6 @@ extern GTY(()) varray_type local_classes;
#endif /* NO_DOLLAR_IN_LABEL */
#define THIS_NAME "this"
#define CTOR_NAME "__ct"
#define DTOR_NAME "__dt"
#define IN_CHARGE_NAME "__in_chrg"

View File

@ -2923,13 +2923,15 @@ initialize_predefined_identifiers (void)
{ "C++", &lang_name_cplusplus, 0 },
{ "C", &lang_name_c, 0 },
{ "Java", &lang_name_java, 0 },
{ CTOR_NAME, &ctor_identifier, 1 },
{ "__base_ctor", &base_ctor_identifier, 1 },
{ "__comp_ctor", &complete_ctor_identifier, 1 },
{ DTOR_NAME, &dtor_identifier, 1 },
{ "__comp_dtor", &complete_dtor_identifier, 1 },
{ "__base_dtor", &base_dtor_identifier, 1 },
{ "__deleting_dtor", &deleting_dtor_identifier, 1 },
/* Some of these names have a trailing space so that it is
impossible for them to conflict with names written by users. */
{ "__ct ", &ctor_identifier, 1 },
{ "__base_ctor ", &base_ctor_identifier, 1 },
{ "__comp_ctor ", &complete_ctor_identifier, 1 },
{ "__dt ", &dtor_identifier, 1 },
{ "__comp_dtor ", &complete_dtor_identifier, 1 },
{ "__base_dtor ", &base_dtor_identifier, 1 },
{ "__deleting_dtor ", &deleting_dtor_identifier, 1 },
{ IN_CHARGE_NAME, &in_charge_identifier, 0 },
{ "nelts", &nelts_identifier, 0 },
{ THIS_NAME, &this_identifier, 0 },

View File

@ -1,3 +1,8 @@
2004-11-24 Mark Mitchell <mark@codesourcery.com>
PR c++/18530
* g++.dg/warn/Wshadow-3.C: New test.
2004-11-24 Devang Patel <dpatel@apple.com>
PR/18555

View File

@ -0,0 +1,8 @@
// PR c++/18530
// { dg-options "-Wshadow" }
struct A {
A();
~A();
void foo (int __ct, int __dt) {}
};