This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13967] A warning could be emitted if a template parameter of a member template is begin shadowed by another member of the class
- From: "gcc-bugs at michaelmellor dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Feb 2004 20:44:08 -0000
- Subject: [Bug c++/13967] A warning could be emitted if a template parameter of a member template is begin shadowed by another member of the class
- References: <20040201233401.13967.gianni@mariani.ws>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gcc-bugs at michaelmellor dot com 2004-02-02 20:44 -------
Gabriel Dos Reis writes:
|Well, I don't think GCC is in error. When you define a function (or a
|class) in a class, it gets rewritten as if it where defined outside of
|the class (which is why we get the reevaluation rule I pointed you to
|in a different PR). Now, when you reevaluate the member template
|outside of the class, name lookup is required to find X::C -- see
|14.6.1/5 and 14.6.1/7
14.6.1/5 and 14.6.1/7 refer to "In the definition of a member of a class
template..." and "In the definition of a class template or in the definition
of a member of such a template..." respectively. The example does not have a
class template, it is a member-template.
So AFAICS GCC is wrong.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13967