This is the mail archive of the gcc-patches@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: [PATCH] Old-C++ ABI inline method heuristic problem


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


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