ogoffart added a comment.

>   What if the constexpr function is called with in a non-constexpr context, 
> e.g. with a random global variable as argument?

__builtin_constant_p will still return false in this case, contrary to gcc 
(whose behavior actually depends on the optimization level).

I think if we really want to get the exact gcc behavior, we need to mix it with 
the optimizer and generate some LLVM intrinsics. But what I was interested on 
with this patch is at least get  a closer behavior as GCC in a constexpr context


https://reviews.llvm.org/D35190



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to