Bug 4803 - Inline function never defined
Summary: Inline function never defined
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.0
: P3 normal
Target Milestone: ---
Assignee: Nathan Sidwell
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2001-11-06 06:26 UTC by m.duflot
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test.C (40 bytes, application/octet-stream)
2003-05-21 15:16 UTC, m.duflot
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m.duflot 2001-11-06 06:26:01 UTC
g++ -c -Wall -ansi test.C
g++ accepts that a function that is declared inline is not defined in the current translation unit.

Release:
3.0

Environment:
Linux
Comment 1 carlo 2001-11-06 17:06:24 UTC
From: Carlo Wood <carlo@alinoe.com>
To: m.duflot@ulg.ac.be
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/4803: Inline function never defined
Date: Tue, 6 Nov 2001 17:06:24 +0100

 On Tue, Nov 06, 2001 at 02:23:10PM -0000, m.duflot@ulg.ac.be wrote:
 > >Description:
 > g++ -c -Wall -ansi test.C
 > g++ accepts that a function that is declared inline is not defined in the current translation unit.
 
 -ansi causes 'inline' to be void, no?
 Or did this code use __inline__ (I can't see that decoded attachment).
 
 -- 
 Carlo Wood <carlo@alinoe.com>
Comment 2 Nathan Sidwell 2001-12-15 10:40:43 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: affirmed. [7.1.2]/4 appears to mandate that 'f()' is
    defined in this TU, as it is used in it.
Comment 3 Nathan Sidwell 2002-01-14 04:14:18 UTC
Responsible-Changed-From-To: unassigned->nathan
Responsible-Changed-Why: patch in progress
Comment 4 Nathan Sidwell 2002-12-26 10:24:34 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: 2002-12-26  Nathan Sidwell  <nathan@codesourcery.com>
    
    	PR c++/4803
    	* decl2.c (mark_used): Defer inline functions.
    	(finish_file): Merge deferred_fns loops. Check all used
    	inline functions have a definition.
    	* method.c (make_thunk): Thunks are not inline.
Comment 5 Nathan Sidwell 2002-12-26 18:20:14 UTC
From: nathan@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/4803
Date: 26 Dec 2002 18:20:14 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	nathan@gcc.gnu.org	2002-12-26 10:20:14
 
 Modified files:
 	gcc/cp         : ChangeLog decl2.c method.c 
 	gcc/testsuite  : ChangeLog 
 	gcc/testsuite/g++.old-deja/g++.brendan: crash64.C 
 	gcc/testsuite/g++.old-deja/g++.jason: synth10.C 
 	gcc/testsuite/g++.old-deja/g++.mike: net31.C p8786.C 
 Added files:
 	gcc/testsuite/g++.dg/warn: inline1.C 
 
 Log message:
 	cp:
 	PR c++/4803
 	* decl2.c (mark_used): Defer inline functions.
 	(finish_file): Merge deferred_fns loops. Check all used
 	inline functions have a definition.
 	* method.c (make_thunk): Thunks are not inline.
 	testsuite:
 	* g++.dg/warn/inline1.C: New test.
 	* g++.old-deja/g++.brendan/crash64.C: Remove spurious inlines.
 	* g++.old-deja/g++.jason/synth10.C: Likewise.
 	* g++.old-deja/g++.mike/net31.C: Likewise.
 	* g++.old-deja/g++.mike/p8786.C: Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3092&r2=1.3093
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.580&r2=1.581
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/method.c.diff?cvsroot=gcc&r1=1.238&r2=1.239
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2278&r2=1.2279
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/inline1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C.diff?cvsroot=gcc&r1=1.3&r2=1.4
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.jason/synth10.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.mike/net31.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.mike/p8786.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
 

Comment 6 Nathan Sidwell 2002-12-26 18:25:14 UTC
From: nathan@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/4803
Date: 26 Dec 2002 18:25:14 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	nathan@gcc.gnu.org	2002-12-26 10:25:14
 
 Modified files:
 	gcc/cp         : ChangeLog decl2.c method.c 
 	gcc/testsuite  : ChangeLog 
 	gcc/testsuite/g++.old-deja/g++.brendan: crash64.C 
 	gcc/testsuite/g++.old-deja/g++.jason: synth10.C 
 	gcc/testsuite/g++.old-deja/g++.mike: net31.C p8786.C 
 Added files:
 	gcc/testsuite/g++.dg/warn: inline1.C 
 
 Log message:
 	cp:
 	PR c++/4803
 	* decl2.c (mark_used): Defer inline functions.
 	(finish_file): Merge deferred_fns loops. Check all used
 	inline functions have a definition.
 	* method.c (make_thunk): Thunks are not inline.
 	testsuite:
 	* g++.dg/warn/inline1.C: New test.
 	* g++.old-deja/g++.brendan/crash64.C: Remove spurious inlines.
 	* g++.old-deja/g++.jason/synth10.C: Likewise.
 	* g++.old-deja/g++.mike/net31.C: Likewise.
 	* g++.old-deja/g++.mike/p8786.C: Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.9&r2=1.3076.2.10
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.575.2.3&r2=1.575.2.4
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/method.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.237&r2=1.237.4.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.9&r2=1.2261.2.10
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/inline1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.brendan/crash64.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3&r2=1.3.64.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.jason/synth10.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2&r2=1.2.74.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.mike/net31.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2&r2=1.2.74.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.mike/p8786.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2&r2=1.2.74.1