This is the mail archive of the gcc@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]

Re: Proposal for extension to GCC


On Aug 19, 2000, Ted Clancy <clancyt@look.ca> wrote:

> 1) First of all, C++ is NOT YACCable.

Indeed.  But since we must support the Standard syntax, it won't
become YACCable just because of your proposal.

> or the token sequence 'A()' could be the construction of a temporary object.
> I want it to be the latter, but it's interpreted as the former.

This isn't going to change, because this is what the Standard
mandates.  Unless you manage to convince change the Standard, which
won't happen in the near future anyway.

> And just change
> 	B b(A(), A());
> to 
> 	B b(A, A);  //explicitly made a function declaration.

But a different one :-)

Or maybe you meant:

B b(A (*)(), A (*)());

> It's much harder to specifiy that you want the ambiguous token
> sequence to be an expression.

Indeed.  You have to enclose the ambiguous expressions in parentheses:

B b((A()), (A()));
(int(*a)), b, c;
(int(*a), b, c);

But this probably fails in GCC, because its parser isn't fully
compliant with the Standard.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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