From: Kriang Lerdsuwanakij Date: Wed, 8 Dec 2004 10:53:29 +0000 (+0000) Subject: re PR c++/18100 (template member with same name as class not rejected) X-Git-Tag: releases/gcc-3.4.4~438 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f969e05145c7242d66cc2c9c61cbff117f626437;p=thirdparty%2Fgcc.git re PR c++/18100 (template member with same name as class not rejected) 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 74da1964be93..6094afa75aee 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-12-08 Kriang Lerdsuwanakij + + 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 PR c++/17011, c++/17971 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index d627e0031afd..0b6dddb01917 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 478bbcefa661..9389ff2efc84 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-12-08 Kriang Lerdsuwanakij + + PR c++/18100 + * g++.dg/lookup/name-clash4.C: New test. + 2004-12-07 Volker Reichelt * g++.dg/other/unreachable-1.C: New test.