This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Old-C++ ABI inline method heuristic problem
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [PATCH] Old-C++ ABI inline method heuristic problem
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Wed, 09 May 2001 16:44:38 +0100
- CC: bernds at redhat dot com, gcc-patches at gcc dot gnu dot org
- Organization: Codesourcery LLC
- References: <20010509162334.P935@sunsite.ms.mff.cuni.cz>
Jakub Jelinek wrote:
> Particularly, if in a compilation unit other than the one which defines
> first non-inline non-abstract virtual method some method is defined as
> inline outside of the class definition and is used only in that compilation
> unit, g++ does not emit the inline body of the function although it is used
> (but it is not emitted in the class-exporting unit either, since it is not
> defined there at all).
If I understand you correctly, you have something like
-- header file
struct Foo{
int baz ();
virtual void keyFunc ();
};
---- in some TUa
inline int Foo::baz () {...}
--- in some TUb
void Foo::keyFunc () {...}
Such code is illformed by 7.1.2/4
If a function with external linkage is declared inline in one
translation unit, it shall be declared inline in all translation
units in which it appears; no diagnostic is required.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org