[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-cxx-dev
Subject:    Re:  CXX-DEV: template arg as base class
From:       Dennis Handly <dhandly () cup ! hp ! com>
Date:       2004-03-23 9:50:50
Message-ID: 200403230950.BAA14715 () hpcll183 ! cup ! hp ! com
[Download RAW message or body]

>From: Ike Naar <ike@sagantec.nl>
>The following program does not compile with HP ANSI C++.
>With GNU g++, Intel C++, Sun C++ it compiles fine.
>Wrong program, or broken compiler?

Both, those compilers are broken for not telling you that your source
is wrong.  14.6.2(3)  (Note the Standard has changed here to NEVER look
in the base class, unless qualified or dependent.)

    template <class T> struct Derived : public T {
      void g() { f(); } // problem lies here
    };

>If the call to f() is changed to T::f() it also compiles fine on HP.
Ike

That or change to "this->f();".  See comments in error 641:
/opt/aCC/lib/nls/msg/C/aCC.msgs
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE cxx-dev
 _________________________________________________________________
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic