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: Namespaces & main()


Gerald Gutierrez <gutier@intergate.bc.ca> writes:

> namespace A { void main () { } }
> namespace B { void main () { } }

> /tmp/ccNoTIxu.s: Assembler messages:
> /tmp/ccNoTIxu.s:27: Fatal error: Symbol main already defined.

> Is this correct C++ behaviour or is this something wrong with egcs ?

It's a bug in egcs.  main() is only reserved in the global namespace,
according to [basic.start.main]/3.  I've installed your testcase in
the testsuite.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org 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]