[gnu.g++.bug] sizeof and uninitialized args

perm@mizar.docs.uu.se (Per Mildner) (05/29/89)

I'm Per-Mildner@AIDA.CSD.UU.SE

 Configuration:
SUN 4 with OS 4
tm.h -> config/tm-sparc+.h
md -> config/sparc.md
g++ version 1.35.0
g++ -Wall -O program.cc

In method struct C *C::C ():
sizeof-bug.cc:17: field `r' used before initialized (after assignment to `this')

// -*- Mode:C++ -*-
// This file: sizeof-bug.cc

class B {
public:
  int x;
  B() {}
  B(B& init) {
    x = init.x;
  }
};

class C {
public:
  B r[1];
  C() {
    this = (C*) new char[sizeof r]; // *** Shouldn't care if initialized?
  }
};

int main (int argc, char* argv[]) {
  return 0;
};