------- Comment #2 from justchecking8964 at gmail dot com 2010-09-08 10:30 ------- (In reply to comment #1) > You are violating the ODR. >
ODR rule relates only to the non-inline functions, which is not the case here, see http://en.wikipedia.org/wiki/One_Definition_Rule : #2: In the entire program, an object or non-inline function cannot have more than one definition; if an object or function is used, it must have exactly one definition. You can declare an object or function that is never used, in which case you don't have to provide a definition. In no event can there be more than one definition. The case that apply here is discussed in point 3: #3: Some things, like types, templates, and extern inline functions, can be defined in more than one translation unit. For a given entity, each definition must be the same. Non-extern objects and functions in different translation units are different entities, even if their names and types are the same. The case above concerns non-extern inline functions, that "are different entities, even if their names and types are the same". -- justchecking8964 at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45594