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]

gcc-3.0 error #19990331 on possibly wrong template code


g++ -v
Reading specs from /opt/gcc-3.0/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../gcc-3.0/configure --prefix=/opt/gcc-3.0
--enable-version-specific-runtime-libs
Thread model: single
gcc version 3.0

The following code produces the error.
If my code is wrong please let me know.

Markus


#include <iostream>

template<class C> class Test {
public:
  template<class D> Test(D& d);

  void Shout() { std::cout << c_ << std::endl; }
private:
  C c_;
};

template<class C>
template<class D>
Test<C>::template Test<D>(D& d) : c_(static_cast<C>(d)) {}


template<class C, class D>
Test<C>
Create(const C& c, const D& d) {
  return Test<C>(d);
}

int main() {
  int i;
  double d = 5.0;
  Create(i,d).Shout();
}




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