This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gnu_inline attribute for C++
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Geoffrey Keating <geoffk at apple dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, Mark Mitchell <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, jakub at redhat dot com
- Date: Wed, 11 Jul 2007 22:50:12 -0300
- Subject: Re: gnu_inline attribute for C++
- References: <orir9d98gq.fsf@oliva.athome.lsd.ic.unicamp.br> <46943918.9040707@codesourcery.com> <m3ps2zr54s.fsf@localhost.localdomain> <m2fy3vh763.fsf@greed.local>
On Jul 11, 2007, Geoffrey Keating <geoffk@apple.com> wrote:
> The C++ language, however, doesn't permit such things, and I doubt
> that the C++ frontend is expecting such things to happen.
When both are defined, only the non-gnu_inline will be compiled anyway.
> What happens if you have a structure definition with the same name in
> both functions, and it needs RTTI support?
I guess this would be one of those cases of "if it hurts, don't do
it", but it's quite likely it will just work as long as the class
definitions abide by the ODR, even if an extern inline function
definition is distinct from the non-inline definition.
--
Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member http://www.fsfla.org/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}