This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17256] New: undefined but used static or inline functions should be diagnosed
- From: "jsm28 at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Sep 2004 00:06:17 -0000
- Subject: [Bug c++/17256] New: undefined but used static or inline functions should be diagnosed
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
inline static void f1(void);
void g1(void) { if (0) { f1(); } }
violates the requirement that "An inline function shall be defined in every
translation unit in which it is used." [basic.odr] paragraph 3, so should be
diagnosed ("used" having a specific definition which covers this case).
The diagnostic should be a pedwarn rather than the existing warning for
inline functions that aren't defined.
Much the same code would probably also facilitate diagnosing the simple
ODR violation, no diagnostic required, where "inline" is removed from
the declaration of f1.
--
Summary: undefined but used static or inline functions should be
diagnosed
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jsm28 at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17256