Re: Question on building a variably modified type at parameter scope

2013-03-08 Thread Eric Botcazou
> I found this is a bug in my front end because I used the same type for the > parameters in different functions, so the references to the parameter in > the structure messed up. > > The thing I want to implement is creating something like this pointers in > C++ of structure type whose variably mo

Re: Question on building a variably modified type at parameter scope

2013-03-08 Thread YU Chenkan
I found this is a bug in my front end because I used the same type for the parameters in different functions, so the references to the parameter in the structure messed up. The thing I want to implement is creating something like this pointers in C++ of structure type whose variably modified field

Re: Question on building a variably modified type at parameter scope

2013-03-05 Thread Eric Botcazou
> I believe this should be possible. I believe that Ada has constructs > like this. I think you will need to use a PLACEHOLDER_EXPR to get the > right thing to happen. In Ada, we indeed have the mechanism in its full generality, i.e. struct S { int a; int b[a]; }; will work anywhere, and for

Re: Question on building a variably modified type at parameter scope

2013-03-05 Thread Richard Kenner
> I believe this should be possible. I believe that Ada has constructs > like this. I think you will need to use a PLACEHOLDER_EXPR to get the > right thing to happen. Yes, that's correct.

Re: Question on building a variably modified type at parameter scope

2013-03-05 Thread Ian Lance Taylor
On Tue, Mar 5, 2013 at 4:49 AM, YU Chenkan wrote: > > I'm a newbie and I'm trying to modify the front end to extend C. > > I know the following code can be accepted, > > void f (struct S { int a; } s, int a[][s.a]) { } . > > I'm wondering whether it is possible to build a structure which h