Bug 86620 - __attribute__((no inline)) gives incorrect warning with overloaded functions
Summary: __attribute__((no inline)) gives incorrect warning with overloaded functions
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 8.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2018-07-21 16:58 UTC by Victor Shoup
Modified: 2018-07-23 09:21 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-07-23 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Shoup 2018-07-21 16:58:59 UTC
Input file GGG.cpp:
struct X;
void h(X&,X&);
inline void h(X&,int) {}
__attribute__((noinline)) void h(X&,X&)  {}

Command line: g++ -c GGG.cpp

Output: 
GGG.cpp:4:32: warning: declaration of 'void h(X&, X&)' with attribute 'noinline' follows inline declaration [-Wattributes]
 __attribute__((noinline)) void h(X&,X&)  {}
                                ^
GGG.cpp:3:13: note: previous definition of 'void h(X&, int)' was here
 inline void h(X&,int) {}

Commentary:
This warning seems incorrect.  
Previous versions of GCC do not emit this warning, even with -Wall -Wextra.
Comment 1 Martin Liška 2018-07-23 09:21:24 UTC
On trunk reported since r248387.