[Bug c++/17256] New: undefined but used static or inline functions should be diagnosed
jsm28 at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Sep 1 00:06:00 GMT 2004
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
More information about the Gcc-bugs
mailing list