Template subclasses do not find variables in their parent classes
Example code that should compile and does not:

template <class S>
class A {
   protected:
     S maxIt;
   public:
     A(S x) {maxIt = x;}
};

template <class S>
class B : public A<S> {
 public:
   B(S d) : A<S>(d) {
      maxIt *= 2;
   }
};


B<int> f()
{
  B<int> b(3);
  return b;
}

-- 
           Summary: Template subclasses do not find variables in their
                    parent classes
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michel at colorado dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to