This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/41690] Scoping is incorrect for inherited classes nested inside a templated class.



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]