aaron.ballman added a comment.

In D150226#4353905 <https://reviews.llvm.org/D150226#4353905>, @dim wrote:

> I submitted a similar workaround for the FreeBSD devel/gdb port, via 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271045 that also applies 
> `-Wno-enum-constexpr-conversion`. As the upstream commit message said, they 
> didn't see any other good way to get rid of the warning, so if there is a 
> workaround clang is OK with, that would be nice. Still, I don't really 
> understand what the value is of making this warning into an error, that is 
> not suppressible?

One of the major selling points to `constexpr` functions in C++ is that they 
cannot contain UB -- if your code compiles, it is correct. This bug that we've 
fixed was another instance of us accidentally allowing UB in a constant 
expression context when we shouldn't have. FWIW, I pointed out a reasonable 
workaround for the freebsd issue: https://reviews.llvm.org/D150226#4342516


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150226/new/

https://reviews.llvm.org/D150226

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

Reply via email to