Bug 65093 - g++ segfaults when compiling a little program
g++ segfaults when compiling a little program
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.3
athlon Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-05-17 06:04 EDT by Need Real Name
Modified: 2007-04-18 12:42 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-12-15 15:28:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-05-17 06:04:02 EDT
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;
}
Comment 1 Alan Cox 2002-12-15 15:28:49 EST
Verified ok with 8.0/gcc 3.2

Note You need to log in before you can comment on or make changes to this bug.