public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gdr at integrable-solutions dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
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
Date: Mon, 02 Feb 2004 21:08:00 -0000	[thread overview]
Message-ID: <20040202210858.30104.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040201233401.13967.gianni@mariani.ws>


------- Additional Comments From gdr at integrable-solutions dot net  2004-02-02 21:08 -------
Subject: Re:  [3.3?/3.4/3.5 regression] template template argument identifier lookup fails scoping rules

"gianni at mariani dot ws" <gcc-bugzilla@gcc.gnu.org> writes:

| Giving this problem some more thought - I'm thinking that there
| should be some kind of diagnostic if a template parameter is hidden,
| at least a warning.

Sure, giving a warning controled by -Wshadow is a good idea 
(I've been thinking about that this morning while walking to work :-).

| The template parameter is useless (at least next to useless) if it's
| hidden and so this is probably not what the coder expected. 

Please remember that a template-parameter can be renammed at will.
In particular, there is no obligation that the template-parameter name
used in the declaration be the same as the one used in the definition.
And the definition can appear very far down in the program (or in
another translation unit.  You don't want the members be "leaked" by
whatever names are used in those definitions.

| I'm obviously not the only one who has been or is surprised by this
| behaviour. 

Well, we're talking about templates, right? :-)

-- Gaby


-- 


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


  parent reply	other threads:[~2004-02-02 21:08 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-01 23:34 [Bug c++/13967] New: template template argument identifier lookup fails scoping rules gianni at mariani dot ws
2004-02-01 23:43 ` [Bug c++/13967] " gianni at mariani dot ws
2004-02-02  0:11 ` gianni at mariani dot ws
2004-02-02  0:42 ` [Bug c++/13967] [3.3?/3.4/3.5 regression] " giovannibajo at libero dot it
2004-02-02  1:02 ` gdr at integrable-solutions dot net
2004-02-02  1:18 ` gianni at mariani dot ws
2004-02-02  1:31 ` gdr at integrable-solutions dot net
2004-02-02  1:49 ` gianni at mariani dot ws
2004-02-02  2:18 ` gdr at integrable-solutions dot net
2004-02-02  3:00 ` gianni at mariani dot ws
2004-02-02 17:32 ` gdr at integrable-solutions dot net
2004-02-02 17:40 ` gdr at integrable-solutions dot net
2004-02-02 18:11 ` giovannibajo at libero dot it
2004-02-02 18:21 ` gianni at mariani dot ws
2004-02-02 19:17 ` gianni at mariani dot ws
2004-02-02 19:33 ` giovannibajo at libero dot it
2004-02-02 19:35 ` [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 giovannibajo at libero dot it
2004-02-02 20:44 ` gcc-bugs at michaelmellor dot com
2004-02-02 21:08 ` gdr at integrable-solutions dot net [this message]
2004-02-02 21:13 ` gdr at integrable-solutions dot net
2004-02-07  8:25 ` gianni at mariani dot ws
2004-02-07  8:29 ` pinskia at gcc dot gnu dot org
2004-02-07  9:06 ` giovannibajo at libero dot it
2004-02-07 13:11 ` gdr at integrable-solutions dot net
2004-02-14  1:12 ` giovannibajo at libero dot it
2004-03-31  9:38 ` giovannibajo at libero dot it
     [not found] <bug-13967-2828@http.gcc.gnu.org/bugzilla/>
2005-11-08  5:23 ` bangerth at dealii dot org
2009-03-03 22:01 ` jason at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040202210858.30104.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).