This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the EGCS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

2.95 problem with 2D arrays of objects



  The following code:

class a {
  int _x;
public:
  a (int x) : _x(x) {} 
};

const a AR1[2] = { a(0), a(1) };

const a AR2[2][2] = { { a(0), a(1) } , { a(2), a(3) } };

  compiled fine with egcs-1.1.2 but with 2.95:

Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95/specs
gcc version 2.95 19990728 (release)

  we get:

g++ q3.cc -o q3
q3.cc: In function `void __static_initialization_and_destruction_0(int,
int)':
q3.cc:10: conversion from `const a[2]' to non-scalar type `a' requested
q3.cc:10: conversion from `const a[2]' to non-scalar type `a' requested

Compilation exited abnormally with code 1 at Fri Jul 30 17:03:58

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]