grigorypas wrote:

> Can you also include a few tests which show whether we suppress the warning 
> on disabled branches of an 'if constexpr'?
> 
> Beware we also have bugs and odd cases in this area:
> 
> * It should be possible to NRVO a variable which you don't actually return, 
> by retuning it only on disabled branches.
>   It would be interesting to see what the warning does in this case.
> * You can generate bad code by returning a variable with the wrong type from 
> a disabled branch.

I added several tests with dead branches. I noticed that Clang missed NRVO 
opportunity in create_object5 test. I wonder if it is a know issue or not. GCC 
seems to handle it. 

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

Reply via email to