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++/11790] New: accepts illegal (referring variable from templated base class)


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: accepts illegal (referring variable from templated base
                    class)
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: shuki_duv at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org

template <typename Type>
struct Base;

template <typename Type>
struct Derived
  : public Base<Type>
{
  int get() { return b; }
};

template <typename Type>
struct Base
{
  int b;
};

int
main()
{
  Derived<char> d;
}

reference to b should be qualified with Base<Type>:: (or imported with using
declaration) for this code to be legal.


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