3 ms·
int foo() { bar(); } is a perfectly well-formed function as long as bar() never returns. Allowing this without requiring bar() to be annotated as noreturn is ge
by plorkyeran 7y ago
int foo() { bar(); } is a perfectly well-formed function as long as bar() never returns. Allowing this without requiring bar() to be annotated as noreturn is generally considered a mistake, but correcting it would break existing valid programs.
- ComputerGuru 7y agoC++17 already made backward compatibility a non-goal (within reason, obviously) and broke previously valid programs.
- ComputerGuru 7y agoI don’t care that my previous comment post has been downvoted, but I do want to clarify that I wasn’t being facetious; C++17 removes a number of old features and constructs that had been previously deprecated and there exist programs that compiled under C++14 that need non-trivial changes to compile under C++17.
- temac 7y ago> but correcting it would break existing valid programs That's very often the case when enhancing static safety guarantees. And that's often worth it.