[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

gdr at integrable-solutions dot net gcc-bugzilla@gcc.gnu.org
Mon Feb 2 21:13:00 GMT 2004


------- Additional Comments From gdr at integrable-solutions dot net  2004-02-02 21:13 -------
Subject: Re:  A warning could be emitted if a template parameter of a member template is begin shadowed by another member of the class

"gcc-bugs at michaelmellor dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| ------- 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.

That is the answer from the Core Group.
As I said, the decision of having class members hide template parameters
was an explicit decision made by the committee.  Parameters of member
templates are no different.

| So AFAICS GCC is wrong.

No, GCC is not wrong.  I just checked with the Core group and John
Spicer said yes, the program is ill-formed.  

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13967



More information about the Gcc-bugs mailing list