https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121159
Lukas Grätz <lukas.gra...@tu-darmstadt.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lukas.graetz@tu-darmstadt.d | |e --- Comment #7 from Lukas Grätz <lukas.gra...@tu-darmstadt.de> --- (In reply to Petr Skocik from comment #6) > (In reply to Jakub Jelinek from comment #5) > > In GCC 15+ one can use [[gnu::musttail]] attribute on the tail call to force > > tail call even when it is [[noreturn]]. No, neither gcc nor clang seem to support this. > > That doesn't seem to work: https://godbolt.org/z/cG1Y77rT7 Well, your example is syntactically incorrect. But even with a syntactic correct version, both gcc and clang seem to be clear that it is not supported: <source>: In function 'callfoo': <source>:3:30: error: cannot tail-call: volatile function type 3 | [[gnu::musttail]] return foo(); | ^~~~~ And with clang: <source>:3:25: error: 'clang::musttail' attribute may not be used with no-return-attribute functions 3 | [[clang::musttail]] return foo(); | ^