misinterpreting a constructor for a function in gcc 2.95
Alexandre Oliva
oliva@dcc.unicamp.br
Tue Aug 31 22:45:00 GMT 1999
On Aug 25, 1999, Stefan Seefeld <seefelds@MAGELLAN.UMontreal.CA> wrote:
> RegionImpl region(Region_var(allocation()), Transform_var(transformation()));
Assuming Region_var and Transform_var are type names, the error
message is correct, according to the C++ Standard. You've got a
function declaration, not an object declaration, definition and
initialization.
> Who is misinterpreting something, me or the compiler ?
You. The compiler is correctly following the C++ disambiguation
rules.
One simple way to disambiguate the declaration in favor of an object
with an initializer is to enclose the first argument in parentheses,
preceded by `0,':
> RegionImpl region((0,Region_var(allocation())), Transform_var(transformation()));
This tells a C++ compiler you mean to have an expression, not an
argument declaration.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them
More information about the Gcc-bugs
mailing list