The following compiles, but it shouldn't, because the typedef
in the base is private (c.f. bugs 29040, 33934, 24118).  Oddly, if
/Intermediate/ is not a template, this correctly fails to compile.

[By the way, thanks for all the good work.-Mike]

--------------------------------------------------------------------------

class Base
{
   typedef int Xtype;
  public:
   Base( Xtype ){}
};

template<typename T>
class Intermediate : public Base
{
  public:
   Intermediate(Xtype aVar = Xtype() ) : Base(aVar){}
};


class Derived : public Intermediate<float>
{
  public:
   Derived(){}
};


int main()
{
   Derived derived;
}


-- 
           Summary: Incorrect access to tyedef in base of template class.
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: m_albert137 at yahoo dot com
  GCC host triplet: x86-64 linux 2.6.22.5-31


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

Reply via email to