Let's say I have 2 TUs with 2 non-inline function definitions with external linkage which differ only in their return types.
Which paragraph(s) my program violates?
[basic.def.odr]/4 says:
Every program shall contain exactly one definition of every non-inline function or variable that is odr-used in that program outside of a discarded statement; no diagnostic required.
But
- This paragraph says "that is odr-used" which may or may not be the case.
- How do I tell if I define the same non-inline function in different TUs, after all? [over.dcl]/1 speaks about the same scope.