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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 9 05:43:21 PDT 2025


AaronBallman 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

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


More information about the cfe-commits mailing list