public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "timothy dot renner at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/41690] Scoping is incorrect for inherited classes nested inside a templated class.
Date: Tue, 13 Oct 2009 06:39:00 -0000	[thread overview]
Message-ID: <20091013063852.3339.qmail@sourceware.org> (raw)
In-Reply-To: <bug-41690-18308@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from timothy dot renner at gmail dot com  2009-10-13 06:38 -------
>Actually it is.
>
>The name of the parent class really is templ<T>::A, which is a templated class.

Sorry, my mistake, I mistyped that.  Let me clarify.  I didn't mean the parent
class, I meant the containing class. I'm not sure what the technical name is
for the class that houses a nested class.  Classes A and B nested in class
templ<TYPE> are definitely templated, but what about classes A and B nested in
class notempl?

What I am curious about is that the compiler does recognize inheritance in a
templated class:
If I added public constructors to both A and B:
   A() {}
and
   B() : A() {}

A() is accessibile by class B, and that code will compile, but the compiler
does not recognize that d_data from A is accessible by B when templation is
involved, but does recognize it when templation is not involved.

I can see it being a more complicated case to parse correctly, but the current
behavior seems inconsistent to me and like something the compiler should not
throw an error on, so if there is a good reason why it should work the way it
currently does, I'd really like to learn what it is.  If not, this bug should
be reopened and kept around at the very least as a "nice to have" feature since
it's easily worked around, or just flat out marked as a won't fix.


-- 


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


  parent reply	other threads:[~2009-10-13  6:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-13  0:31 [Bug c++/41690] New: " timothy dot renner at gmail dot com
2009-10-13  1:08 ` [Bug c++/41690] " paolo dot carlini at oracle dot com
2009-10-13  5:48 ` timothy dot renner at gmail dot com
2009-10-13  5:56 ` pinskia at gcc dot gnu dot org
2009-10-13  6:39 ` timothy dot renner at gmail dot com [this message]
2009-10-13 10:26 ` paolo dot carlini at oracle dot com
2009-10-13 11:03 ` redi at gcc dot gnu dot org
2009-10-13 11:56 ` paolo dot carlini at oracle dot com

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=20091013063852.3339.qmail@sourceware.org \
    --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).