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++/15639] New: Fails to find inherited function


template<typename T>
class A{
public:
    T*  F(int i) { return 0;}
    };

template<typename U, template<typename> class B>
class C: public B<U> {
public:
    void    G() {
        U* u = F(5);
        }
    };
int main() {
    C<bool, A> c;
    c.G();
    return 0;
    }

gives:

~/ootbc/common/test/src$ g++ foo.cc
foo.cc: In member function `void C<U, B>::G()':
foo.cc:11: error: there are no arguments to `F' that depend on a template parameter, so a declaration of `F' must be available
foo.cc:11: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)


However, the explicit invocation of C<bool, A> binds U to bool and B to A, so the "c" derives from A<bool>, which does in fact have an F(int) to call and is available.

Ivan

-- 
           Summary: Fails to find inherited function
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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