]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/18100 (template member with same name as class not rejected)
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Wed, 8 Dec 2004 10:53:29 +0000 (10:53 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Wed, 8 Dec 2004 10:53:29 +0000 (10:53 +0000)
PR c++/18100
* name-lookup.c (push_class_level_binding): Diagnose nested
class template with the same name as enclosing class.

* g++.dg/lookup/name-clash4.C: New test.

From-SVN: r91869

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog

index 74da1964be933e7e29d24c9acec88116c71ee99d..6094afa75aeec7a49493e12fa0ecb2f503e89418 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/18100
+       * name-lookup.c (push_class_level_binding): Diagnose nested
+       class template with the same name as enclosing class.
+
 2004-12-04  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/17011, c++/17971
index d627e0031afd2da5821df65d34a901d6a58143e1..0b6dddb01917f62075ec350f897efe029b2dba97 100644 (file)
@@ -2804,6 +2804,7 @@ push_class_level_binding (tree name, tree x)
        || TREE_CODE (x) == CONST_DECL
        || (TREE_CODE (x) == TYPE_DECL
           && !DECL_SELF_REFERENCE_P (x))
+       || DECL_CLASS_TEMPLATE_P (x)
        /* A data member of an anonymous union.  */
        || (TREE_CODE (x) == FIELD_DECL
           && DECL_CONTEXT (x) != current_class_type))
index 478bbcefa661a642446855bd2873b32ad4886455..9389ff2efc8438181466dbeda4ef6dd90edc6c39 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-08  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/18100
+       * g++.dg/lookup/name-clash4.C: New test.
+
 2004-12-07  Volker Reichelt  <reichelt@gcc.gnu.org>
 
        * g++.dg/other/unreachable-1.C: New test.