This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [C++ Patch] PR 54501


Hi again,

On 10/18/2012 06:02 PM, Jason Merrill wrote:
On 10/18/2012 01:15 AM, Paolo Carlini wrote:
If I understand correctly your hesitations, I don't think there are
exceptions to the general rule that if the size of the array is zero
there can be no initializers.

I'm thinking of a testcase like this, which is currently accepted:


struct A
{
  int i[0];
  int j;
};

struct A a = { 1 };

Here, since i has no elements, we should skip over it and apply the one initializer to j.
Thus, I looked into what you did lately for c++/54441, and the below is what I regtested so far: I'm directly recognizing the situations leading to infinite loops. Note, I don't exclude that formally the whole iteration could be streamlined a bit, but like this it seems still quite understandable.

Tested x86_64-linux as usual..

Thanks,
Paolo.

///////////////////////////

Attachment: CL_54501_3
Description: Text document

Attachment: patch_54501_3
Description: Text document


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