public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15639] New: Fails to find inherited function
@ 2004-05-25 18:26 igodard at pacbell dot net
  2004-05-25 18:26 ` [Bug c++/15639] " bangerth at dealii dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: igodard at pacbell dot net @ 2004-05-25 18:26 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-11-05 19:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-25 18:26 [Bug c++/15639] New: Fails to find inherited function igodard at pacbell dot net
2004-05-25 18:26 ` [Bug c++/15639] " bangerth at dealii dot org
2004-05-25 18:27 ` igodard at pacbell dot net
2004-05-25 18:29 ` pinskia at gcc dot gnu dot org
2004-05-25 19:07 ` gdr at integrable-solutions dot net
2004-05-25 19:34 ` bangerth at dealii dot org
2004-05-25 19:35 ` igodard at pacbell dot net
2004-05-25 22:52 ` giovannibajo at libero dot it
2004-11-05 19:28 ` bangerth at dealii dot org
2004-11-05 19:32 ` bangerth at dealii dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).