gcc-3.0 error #19990331 on possibly wrong template code
Markus Werle
markus@lufmech.rwth-aachen.de
Tue Jul 3 08:25:00 GMT 2001
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();
}
More information about the Gcc-bugs
mailing list