[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 26 16:05:58 PDT 2016


jlebar added a comment.

> I'm not sure about that. It seems like a useful feature for the builtins to have. Logically speaking, they should be constexpr.

I agree that it's logically correct for the builtins to be constexpr-evaluatable.  My point is just that doing this work and then writing a test doesn't buy us much in terms of ensuring that CUDA compilation doesn't break due to changes to libc++.

>> In addition, if I understand you correctly, we wouldn't be able to test all of the functions here, only the ones that call builtins.
> 
> What do you mean?

This patch adds constexpr to six function definitions, but only three of them directly call a builtin.  If I understand your proposal correctly, the other three function definitions would remain not-constexpr-evaluatable, and thus untested.


https://reviews.llvm.org/D25403





More information about the cfe-commits mailing list