* [Bug c++/17256] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
@ 2004-09-01 0:51 ` geoffk at geoffk dot org
2004-09-01 4:19 ` giovannibajo at libero dot it
` (9 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: geoffk at geoffk dot org @ 2004-09-01 0:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From geoffk at geoffk dot org 2004-09-01 00:51 -------
Subject: Re: New: undefined but used static or inline
functions should be diagnosed
The code that does this in the case where an inline function is truly used
lives in cp/decl2.c, just under the comment
/* All used inline functions must have a definition at this point. */
However, it checks TREE_USED, which may not be the right thing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
2004-09-01 0:51 ` [Bug c++/17256] " geoffk at geoffk dot org
@ 2004-09-01 4:19 ` giovannibajo at libero dot it
2004-09-01 4:20 ` giovannibajo at libero dot it
` (8 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: giovannibajo at libero dot it @ 2004-09-01 4:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-09-01 04:19 -------
Confirmed, a regression on all open branches and mainline.
Geoff: the decl is marked with TREE_USED, but the predicate DECL_REALLY_EXTERN
holds true for it. Any idea why?
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |geoffk at geoffk dot org,
| |giovannibajo at libero dot
| |it
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |accepts-invalid
Known to fail| |3.3.4 3.4.0 3.5.0
Known to work| |2.95.3
Last reconfirmed|0000-00-00 00:00:00 |2004-09-01 04:19:50
date| |
Target Milestone|--- |3.3.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
2004-09-01 0:51 ` [Bug c++/17256] " geoffk at geoffk dot org
2004-09-01 4:19 ` giovannibajo at libero dot it
@ 2004-09-01 4:20 ` giovannibajo at libero dot it
2004-09-28 13:41 ` [Bug c++/17256] [3.3/3.4/4.0 Regression] " gdr at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: giovannibajo at libero dot it @ 2004-09-01 4:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-09-01 04:20 -------
(In reply to comment #2)
> Geoff: the decl is marked with TREE_USED, but the predicate
DECL_REALLY_EXTERN
> holds true for it.
Sorry, I meant that DECL_REALLY_EXTERN is *false* for the decl, so the
diagnostic is not emitted.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.3/3.4/4.0 Regression] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-09-01 4:20 ` giovannibajo at libero dot it
@ 2004-09-28 13:41 ` gdr at gcc dot gnu dot org
2004-12-08 20:52 ` [Bug c++/17256] [3.3/3.4 " pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: gdr at gcc dot gnu dot org @ 2004-09-28 13:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at gcc dot gnu dot org 2004-09-28 13:39 -------
Adjust milestone
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|3.3.4 3.4.0 4.0 |3.3.4 3.4.0 4.0.0
Target Milestone|3.3.5 |3.3.6
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.3/3.4 Regression] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
` (3 preceding siblings ...)
2004-09-28 13:41 ` [Bug c++/17256] [3.3/3.4/4.0 Regression] " gdr at gcc dot gnu dot org
@ 2004-12-08 20:52 ` pinskia at gcc dot gnu dot org
2005-03-09 4:49 ` [Bug c++/17256] [3.3/3.4/4.0/4.1 " pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-08 20:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-08 20:52 -------
This is fixed at least on the mainline.
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|3.3.4 3.4.0 4.0.0 |3.3.4 3.4.0
Known to work|2.95.3 |2.95.3 4.0.0
Summary|[3.3/3.4/4.0 Regression] |[3.3/3.4 Regression]
|undefined but used static or|undefined but used static or
|inline functions should be |inline functions should be
|diagnosed |diagnosed
Target Milestone|3.3.6 |3.4.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.3/3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
` (4 preceding siblings ...)
2004-12-08 20:52 ` [Bug c++/17256] [3.3/3.4 " pinskia at gcc dot gnu dot org
@ 2005-03-09 4:49 ` pinskia at gcc dot gnu dot org
2005-05-19 17:42 ` mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-09 4:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-09 04:49 -------
This broke again on the mainline (before the branch of 4.0.0 and even before 3.5.0 was changed to
4.0.0).
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Known to fail|3.3.4 3.4.0 |3.3.4 3.4.0 4.0.0 4.1.0
Known to work|2.95.3 4.0.0 |2.95.3
Summary|[3.3/3.4 Regression] |[3.3/3.4/4.0/4.1 Regression]
|undefined but used static or|undefined but used static or
|inline functions should be |inline functions should be
|diagnosed |diagnosed
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.3/3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-03-09 4:49 ` [Bug c++/17256] [3.3/3.4/4.0/4.1 " pinskia at gcc dot gnu dot org
@ 2005-05-19 17:42 ` mmitchel at gcc dot gnu dot org
2005-06-13 13:52 ` [Bug c++/17256] [3.4/4.0/4.1 " phython at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:42 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4.4 |3.4.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-05-19 17:42 ` mmitchel at gcc dot gnu dot org
@ 2005-06-13 13:52 ` phython at gcc dot gnu dot org
2005-07-22 21:15 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: phython at gcc dot gnu dot org @ 2005-06-13 13:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From phython at gcc dot gnu dot org 2005-06-13 13:52 -------
Shouldn't TREE_STATIC be checked on the FUNCTION_DECL to see if it has been defined?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-06-13 13:52 ` [Bug c++/17256] [3.4/4.0/4.1 " phython at gcc dot gnu dot org
@ 2005-07-22 21:15 ` pinskia at gcc dot gnu dot org
2005-09-07 19:11 ` pinskia at gcc dot gnu dot org
2005-09-27 16:19 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-22 21:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-22 21:12 -------
Moving to 4.0.2 pre Mark.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4.5 |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-07-22 21:15 ` pinskia at gcc dot gnu dot org
@ 2005-09-07 19:11 ` pinskia at gcc dot gnu dot org
2005-09-27 16:19 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-07 19:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-07 19:11 -------
Hmm, this works correctly with the C front-end.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
2004-09-01 0:06 [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed jsm28 at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-09-07 19:11 ` pinskia at gcc dot gnu dot org
@ 2005-09-27 16:19 ` mmitchel at gcc dot gnu dot org
10 siblings, 0 replies; 18+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:19 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.2 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
[not found] <bug-17256-230@http.gcc.gnu.org/bugzilla/>
@ 2005-10-11 6:41 ` phython at gcc dot gnu dot org
2005-10-11 6:42 ` phython at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: phython at gcc dot gnu dot org @ 2005-10-11 6:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from phython at gcc dot gnu dot org 2005-10-11 06:41 -------
Created an attachment (id=9962)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9962&action=view)
treat nonmember static functions like inline functions
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
[not found] <bug-17256-230@http.gcc.gnu.org/bugzilla/>
2005-10-11 6:41 ` phython at gcc dot gnu dot org
@ 2005-10-11 6:42 ` phython at gcc dot gnu dot org
2005-10-29 1:50 ` jason at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: phython at gcc dot gnu dot org @ 2005-10-11 6:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from phython at gcc dot gnu dot org 2005-10-11 06:42 -------
Created an attachment (id=9963)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9963&action=view)
testcase
This patch also changes the error in:
static void f();
void g() { f(); }
into a warning.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
[not found] <bug-17256-230@http.gcc.gnu.org/bugzilla/>
2005-10-11 6:41 ` phython at gcc dot gnu dot org
2005-10-11 6:42 ` phython at gcc dot gnu dot org
@ 2005-10-29 1:50 ` jason at gcc dot gnu dot org
2005-10-30 22:51 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: jason at gcc dot gnu dot org @ 2005-10-29 1:50 UTC (permalink / raw)
To: gcc-bugs
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jason at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2005-07-12 06:35:36 |2005-10-29 01:50:21
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
[not found] <bug-17256-230@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2005-10-29 1:50 ` jason at gcc dot gnu dot org
@ 2005-10-30 22:51 ` mmitchel at gcc dot gnu dot org
2005-11-03 22:12 ` janis at gcc dot gnu dot org
2005-11-07 6:17 ` jason at gcc dot gnu dot org
5 siblings, 0 replies; 18+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-30 22:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from mmitchel at gcc dot gnu dot org 2005-10-30 22:51 -------
Leaving as P2; we should try to fix this, but it's not a showstopper.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
[not found] <bug-17256-230@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2005-10-30 22:51 ` mmitchel at gcc dot gnu dot org
@ 2005-11-03 22:12 ` janis at gcc dot gnu dot org
2005-11-07 6:17 ` jason at gcc dot gnu dot org
5 siblings, 0 replies; 18+ messages in thread
From: janis at gcc dot gnu dot org @ 2005-11-03 22:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from janis at gcc dot gnu dot org 2005-11-03 22:12 -------
A regression hunt showed that "warning: inline function `void f1()' used
but never defined" disappeared with this patch to make the C++ front end
always work in unit-at-a-time mode:
r85309 | mmitchel | 2004-07-29 17:59:31 +0000 (Thu, 29 Jul 2004) | 124 lines
http://gcc.gnu.org/viewcvs?view=rev&rev=85309
Sometime in 2004-09-09 - 2004-09-24 it got "error: 'void f1()' used but
never defined", which went away sometime in 2004-10-08 - 2004-10-27. I can
run regression hunts on either or both of those if the information would be
useful.
The patch in comment #10 has never been submitted, so this PR doesn't have
the "patch" keyword.
--
janis at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug c++/17256] [3.4/4.0/4.1 Regression] undefined but used static or inline functions should be diagnosed
[not found] <bug-17256-230@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2005-11-03 22:12 ` janis at gcc dot gnu dot org
@ 2005-11-07 6:17 ` jason at gcc dot gnu dot org
5 siblings, 0 replies; 18+ messages in thread
From: jason at gcc dot gnu dot org @ 2005-11-07 6:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from jason at gcc dot gnu dot org 2005-11-07 06:17 -------
Subject: Bug 17256
Author: jason
Date: Mon Nov 7 06:17:47 2005
New Revision: 106581
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106581
Log:
PR c++/17256
* decl2.c (cp_finish_file): Fix conditions for undefined warning.
Set TREE_NO_WARNING instead of TREE_PUBLIC.
* pt.c (instantiate_pending_templates): Set DECL_INITIAL to avoid
a warning on a function we didn't instantiate because of excessive
recursion.
Added:
trunk/gcc/testsuite/g++.dg/warn/undefined1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl2.c
trunk/gcc/cp/pt.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256
^ permalink raw reply [flat|nested] 18+ messages in thread