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


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

c++/140: Re: array initializer problem



>Number:         140
>Category:       c++
>Synopsis:       array initializer problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          analyzed
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 26 11:26:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     john@nanaon-sha.co.jp (John Belmonte)
>Release:        2.95.2
>Organization:
NanaOn-Sha Co Ltd
>Environment:
>Description:
 Original-Message-ID: <000801bf1bb6$693bfc80$0e02a8c0@johngateway>
 Date: Thu, 21 Oct 1999 20:21:24 +0900
 

 In the attached program I would expect the assertion in main() to be valid,
 but it fails.

>How-To-Repeat:
#include <assert.h>
struct GOOF {
  int a;
};

const GOOF g1[] = {
  { 1 }
};

const GOOF g2[][1] = {
  { g1[0] }
};

int main()
{
    assert(g2[0][0].a == g1[0].a);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:

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