[Bug c++/52620] using cannot import types in (non direct) base classes

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 19 16:35:00 GMT 2012


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-19 16:31:04 UTC ---
(In reply to comment #2)
> (I pasted the wrong bug report, I meant
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21484)

That's a dup of PR 14258 so should be fixed for 4.7, and I think this is the
same issue.


> (In reply to comment #1)
> > template <typename T>
> > struct bot: med<T>
> > {
> >   using top::type;
> > 
> > This is not valid, med<T> is a dependent base class so name lookup never looks
> > in it, so top is not known to be a base class.
> 
> Ah, thanks for the clarification!

I believe it's a bug in clang if it accepts it.


> > If you remove that line G++ accepts the code.
> 
> Ah, somehow I broke my tests.  4.6.3 does not accept it (and is the compiler
> I am actually using), but you are right that 4.7.0 is fine with it.

Yes, the 'using' code was significantly improved for 4.7, see the release notes
at http://gcc.gnu.org/gcc-4.7/changes.html#cxx

*** This bug has been marked as a duplicate of bug 14258 ***



More information about the Gcc-bugs mailing list