Commit 9da32fe1 by Jason Merrill Committed by Jason Merrill

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
parent cb713a8d
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.
......
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
......
......@@ -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;
......
// PR c++/10929
// { dg-options "-Winline -O3" }
int foo ();
int bar () { return foo (); }
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment