Hide Forgot
From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020502 Description of problem: this program crashes g++ Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. just compile it with g++ -Wall -g Additional info: template <class G, class P> class evaluator { public: typedef G genotype; typedef P phenotype; virtual phenotype operator()(const genotype& p) const = 0; }; template <typename E> class base: public E::genotype { public: typedef typename E::genotype genotype; typedef typename E::phenotype phenotype; virtual phenotype fitness() // = 0; { return E()(genotype(*this)); } }; template <typename E, E& e> class base2: public E::genotype { public: typedef typename E::genotype genotype; typedef typename E::phenotype phenotype; virtual phenotype fitness() // = 0; { return e(genotype(*this)); } }; struct xy { float x, y; }; class z: public evaluator<xy, float> { public: phenotype operator()(const genotype& p) const { return p.x * p.y; } }; z z1; int main() { base<z> b1; base2<z, z1> b2; b1.~base<z>(); b2.~base2<z, z1>(); return 0; }
Verified ok with 8.0/gcc 3.2