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]
Other format: [Raw text]

Re: [Bug c/22052] [4.0/4.1 Regression] redefinition of inline functionsucceeds


On Mon, 27 Jun 2005, Eric Christopher wrote:

> > What does the patch do for the case of two definitions, both extern 
> > inline, in the same translation unit?  The GCC versions (3.0 and later) I 
> > have around reject it, older ones accept it.  In any case, I think this 
> > case should have a testcase.
> > 
> > extern inline int foo(void) { return 0; }
> > extern inline int foo(void) { return 0; }
> > 
> 
> This testcase fails with a redefinition error... is this the behavior we
> want?

As recent GCC rejects it, I think an error is indeed the desired behavior.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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