aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-11-24 17:57:00 +0000
committerMark Mitchell <mark@codesourcery.com>2004-11-24 17:57:00 +0000
commit847c980f197372e7b8344720896df89b52c6563f (patch)
tree06908605a3c1852535c1e9158c9bb761d90add0f /gcc/cp/decl.c
parentd97dbb0b49916051e5b0d3e23c0ce3941d15c301 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@91179 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index bca328846e5..258ae43baea 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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 },