[clang] [Clang][Sema]:Fix musttail attribute on a function with not_tail_called attribute has no warning/error (PR #134465)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 9 06:12:50 PDT 2025


erichkeane wrote:

> > @AaronBallman @erichkeane Thank you for your comments. There's a question here about whether to report an error or a warning here, and you're in a divided opinion. My opinion is that it is better to use the error report here. Because these are two mutually exclusive conditions, it is semantically unreasonable to set tail calls or non-tail calls even if the program is still run after a warning is reported. I still want to hear your opinions. Regarding the PR title, PR information, test cases, I will fill in the next submission. Thank you both again.
> 
> I favor an error in this case because the whole point to `musttail` is to _ensure_ that a tail call happens or the code is rejected: https://clang.llvm.org/docs/AttributeReference.html#musttail

I lean towards warning, only because the behavior is 'ignored attribute', and those are a specific warning group.

https://github.com/llvm/llvm-project/pull/134465


More information about the cfe-commits mailing list