[gnu.g++.bug] g++ 1.34.2 sizeof bug

francis%sunquest.UUCP@ARIZONA.EDU ("Francis Sullivan") (09/27/89)

%
% cat size.cc
#include <stream.h>
class Int {
  private:
    int value;
    char str[20];

  public:
    Int(int i) { value = i; };
    operator()() { return value; };
};

main() {
Int a = 1, b = 2, c = 3;
Int& all[/* max_all */] = { a, b , c};
const max_all = (sizeof(all)/sizeof(Int&));

cout << "max_all's value is " << max_all << "\n";
for (int i = 0 ; i < max_all; i++)
   cout << "all[" << i << "] = " << all[i]() << "\n";
}
% g++ -v
g++ version 1.34.2
% cat /etc/motd
SunOS Release 4.0 (SQDL60) #1: Fri Mar 10 18:55:26 MST 1989
% g++ size.cc
% a.out
max_all's value is 0
%
-- should be 3, and it is if you comment out 'char str[20];'