re PR c++/10929 (-Winline warns about functions for which no definition is visible)

PR c++/10929
        * tree-inline.c (expand_call_inline): Don't warn about failing to
        inline a function which was made inline by -finline-functions.
        * cp/decl.c (grokfndecl): Don't mark a function inline for
        -finline-functions if it isn't defined.

From-SVN: r68122
This commit is contained in:
Jason Merrill 2003-06-17 19:00:16 -04:00 committed by Jason Merrill
parent cb713a8d52
commit 9da32fe151
5 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2003-06-17 Jason Merrill <jason@redhat.com>
PR c++/10929
* tree-inline.c (expand_call_inline): Don't warn about failing to
inline a function which was made inline by -finline-functions.
2003-06-17 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300-protos.h: Update to ISO C.

View File

@ -1,3 +1,9 @@
2003-06-17 Jason Merrill <jason@redhat.com>
PR c++/10929
* decl.c (grokfndecl): Don't mark a function inline for
-finline-functions if it isn't defined.
2003-06-17 Mark Mitchell <mark@codesourcery.com>
PR c++/10712

View File

@ -8883,7 +8883,7 @@ grokfndecl (tree ctype,
the user explicitly asks us to, all functions. */
if (DECL_DECLARED_INLINE_P (decl))
DECL_INLINE (decl) = 1;
if (flag_inline_trees == 2 && !DECL_INLINE (decl))
if (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag)
{
DID_INLINE_FUNC (decl) = 1;
DECL_INLINE (decl) = 1;

View File

@ -0,0 +1,5 @@
// PR c++/10929
// { dg-options "-Winline -O3" }
int foo ();
int bar () { return foo (); }

View File

@ -1201,7 +1201,7 @@ expand_call_inline (tp, walk_subtrees, data)
|| !cgraph_global_info (fn)->inline_once)
&& !inlinable_function_p (fn, id, 0))
{
if (warn_inline && DECL_INLINE (fn))
if (warn_inline && DECL_INLINE (fn) && !DID_INLINE_FUNC (fn))
{
warning_with_decl (fn, "inlining failed in call to `%s'");
warning ("called from here");