---------- Forwarded message ---------
From: sasho648 <sasho648@gmail.com>
Date: Thu, May 4, 2023 at 9:19 PM
Subject: Re: [std-proposals] Drop same sequence of tokens for inline
To: Jonathan Wakely <cxx@kayari.org>


Well we could add wording for that specific case.

On Thu, May 4, 2023 at 9:12 PM Jonathan Wakely <cxx@kayari.org> wrote:


On Thu, 4 May 2023 at 18:27, sasho648 via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
I mean the one available in current TU.

And then you break every inline function that uses a local static variable.

 

On Thu, May 4, 2023 at 8:26 PM sasho648 <sasho648@gmail.com> wrote:
Well just require an implementation to use the inline version, if it's available.

On Thu, May 4, 2023 at 8:19 PM Sebastian Wittmeier via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

There is no guarantee that inline functions are actually inlined.

They could even be inlined sometimes within a TU (hot code path) and sometimes call a function, which is shared between TUs.

It could generally lead to hard-to-find bugs, if the function definitions would be different, depending on who calls the function.
 

-----Ursprüngliche Nachricht-----
Von: sasho648 via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Do 04.05.2023 19:12
Betreff: [std-proposals] Drop same sequence of tokens for inline
An: std-proposals@lists.isocpp.org;
CC: sasho648 <sasho648@gmail.com>;
So why does inline functions need to have the same sequence of tokens in different TU - imagine in a TU there is a preprocessor define that changes the function definition - it would make sense this not to be UB.
 
In C inline functions have internal linkage - it would make the same sense for C++.
 
Like I don't see a reason requiring inline functions to have the same body - regardless of the statement above.
-- 
 Std-Proposals mailing list
 Std-Proposals@lists.isocpp.org
 https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
 
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals