The inherited methods should be implicitely visible from a derived class, which
is not the case in g++. Refer to sample code below.

--------------------------------------------------------------------------------
File: quantifier.cpp
--------------------------------------------------------------------------------

/** @file qualifier.cpp */
struct base {
  void f( int const& ) const {}
};

class derived: public base {
  int _i;
  public:
  derived(): base(), _i(0) {}
  void f() const { /*base::*/f( _i ); }
};

--------------------------------------------------------------------------------
Compilation error (when "base::" is commented out) -- The command line is:
g++ -Wall -Werror -ansi -pedantic -c qualifier.cpp -o /dev/null
--------------------------------------------------------------------------------

qualifier.cpp: In member function `void derived::f() const':
qualifier.cpp:11: error: no matching function for call to `derived::f(const
int&) const'
qualifier.cpp:11: error: candidates are: void derived::f() const


-- 
           Summary: Public method inheritance fails
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sylvain dot guilley at enst dot fr


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

Reply via email to