Bug 11067 - [3.3/3.4 regression] Strange warning with abstract virtual inline function
Summary: [3.3/3.4 regression] Strange warning with abstract virtual inline function
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.1
: P3 normal
Target Milestone: 3.3.1
Assignee: Andrew Pinski
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2003-06-02 18:19 UTC by Volker Reichelt
Modified: 2004-01-17 04:22 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-06-22 02:47:56


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2003-06-02 18:19:38 UTC
Compiling the following code snippet, I get a strange warning:

-------------------------------------------------
struct A
{
    virtual inline void foo() const=0;
    void bar() { foo(); }
};
-------------------------------------------------

The warning reads:
warn.cc:3: warning: inline function `virtual void A::foo() const' used but 
   never defined

The keyword "inline" doesn't make much sense, but the warning is confusing IMHO.
The warning was introduced in gcc 3.3, so I rate this as a regression.
Comment 1 Andrew Pinski 2003-06-02 18:45:42 UTC
One of the reason the warning was introduced in 3.3 was because -Winline was not say 
when something was not inlined, now it looks like it is over warning.  It is most likely 
connected with bug 10929.
Comment 2 Andrew Pinski 2003-06-22 02:47:43 UTC
I have a small patch  which fixes this, will post soon.
Comment 3 janis187 2003-06-23 16:00:01 UTC
The regression in 11067 was introduced/exposed by this patch (I see that
Andrew has a patch, but this might still be useful):

--- gcc/gcc/cp/ChangeLog ---

> 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 Andrew Pinski 2003-06-24 21:18:13 UTC
The warning is right so closing as not going to be fixed.