egcs-1.1b: multiple template inheritance problem

Chris Metcalf metcalf@incert.com
Mon Sep 28 10:38:00 GMT 1998


The following program fails to compile under egcs-1.1b
(i386-pc-solaris2.6, i386-cygwin32):

  template <class FOO> class BAR {
  public:
    void func1();
  };

  class BAZ : public BAR<int>, BAR<char*> { };

  void func2(BAZ* b)
  {
    b->BAR<int>::func1();
  }

The generated error text is

  foo.cpp: In function `void func2(class BAZ *)':
  foo.cpp:10: request for member `BAR' is ambiguous
  foo.cpp:10: parse error before `>'

This compiles correctly under egcs 1.0.3 (and Visual C++).

                Chris Metcalf -- InCert Software -- 1 (617) 621 8080
                metcalf@incert.com -- http://www.incert.com/~metcalf





More information about the Gcc-bugs mailing list