The following code fails to compile:

template <class T>
class Foo {
  Foo(int i, int j) {}

class Bar : public Foo<int> {
  Bar() : Foo(0, 0) {}

This produces the following output: In constructor ?Bar::Bar()?: error: class ?Bar? does not have any field named ?Foo? error: no matching function for call to ?Foo<int>::Foo()? note: candidates are: Foo<T>::Foo(int, int) [with T = int] note:                 Foo<int>::Foo(const Foo<int>&)

If I change line 8 to "Bar() : Foo<int>(0, 0) {}" it compiles fine. The
original code also compiles fine with clang and comeau. Tested with head gcc,
4.3, and 4.4.

           Summary: Unable to find base class constructor of templated base
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andareed at gmail dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu

Reply via email to