https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124088
--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Matthias Kretz (Vir) from comment #5) > Was the following considered? When compiling with any enforcing contract > evaluation semantic (and a direct or indirect use of contract checks), give > inline functions an ABI tag / different mangling. That way the assumptions > in calling functions cannot be broken via linking. (… except by changing the > predicate in another TU. I am pretty sure that this and its variants has been discussed - but during the design phases. > But I hope we can file that as an ODR violation?) Well .. you are expressing a desire that these mismatches should look like an ODR violation .. but (AFAIU the design) unless a resolution can be found that makes stuff work in such aa way as differences are non-breaking .. the solution where this is defined _not_ to be an ODR violation is the prevailing fix. We cannot answer these questions here - they need to be taken to a forum with the designers present. > A lot of C++ code is inline these days and the default is to enforce, so > yes, this can be expensive. But this sounds like a trade-off a user might > want to decide. Well the expense is not applied to every inline function - only locally to contract conditions where they are applied. Yes, of course, it is probably an objective that the majority of functions would end up with some contracts...
