TiborGY wrote:

> I feel like this is a solution that can grow out of hand very easily. IMO the 
> better solution would be to have `-Wmissing-noreturn` place a `[[noreturn]]` 
> into the AST to avoid incorrect follow-up diagnostics.

I agree, in principle I would expect Clang to be able to prove (in simple 
cases) that a function cannot return, and then treat them -as-if they were 
marked as `[[noreturn]]` in the source code, not just for purposes of 
diagnostics but also optimization. Suppressing the `-Wreturn-type` warning does 
not achieve that.

https://github.com/llvm/llvm-project/pull/145166
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to