This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17256] New: undefined but used static or inline functions should be diagnosed


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]