diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8797df9d516e61fba890de2e559dc37904a7999c..faf73ad89fd3d28f21be18a1098e951818631466 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 40979fb21a321065a7aece75bbc2a042a5025a9e..64f5ab9b8ada59cb8cffd31db900ed9566a1f974 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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"
 
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index bca328846e555e630bdb012abe3a051c51a35acd..258ae43baea3ad3872931465c651fafa18cddfe7 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 },
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cb68c281d2283567dacf44d17bf8353a30e3cb99..03014a1ee3f3d4fac495080f11f2f47b9a4a4a02 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-3.C b/gcc/testsuite/g++.dg/warn/Wshadow-3.C
new file mode 100644
index 0000000000000000000000000000000000000000..99add19a4357faa28fe907d8e6ba542f848e9727
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wshadow-3.C
@@ -0,0 +1,8 @@
+// PR c++/18530
+// { dg-options "-Wshadow" }
+
+struct A {
+  A();
+  ~A();
+  void foo (int __ct, int __dt) {}
+};