mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-20 22:19:38 +08:00
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:
parent
cb713a8d52
commit
9da32fe151
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
5
gcc/testsuite/g++.dg/warn/Winline-2.C
Normal file
5
gcc/testsuite/g++.dg/warn/Winline-2.C
Normal file
@ -0,0 +1,5 @@
|
||||
// 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");
|
||||
|
Loading…
Reference in New Issue
Block a user