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: Potential scope/casting bug(?)


Hannu Koivisto <azure@iki.fi> writes:

>             void(kala  (  10, 'a'  ));
>             void(kala2  ());

According to the FDIS [stmt.ambig], these are to be parsed as a
declarations, not function calls.  The first declares an object named
`kala', initialized with two arguments, which turns out to be invalid
because it has type void, but disambiguation is syntactic.  The second
declares a function named kala2, that takes an empty list of arguments
and returns void.

>             void(::kala  (  10, 'a'  ));
>             void(::kala2  ());

IMHO, these should also be considered declarations, but egcs considers
these function invocations.  The first should be an invalid
definition of an object `kala' in the global namespace, while the
second would be a valid redeclaration of global function `kala2'.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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