[cfe-users] Unexpected (IMO) constant-conversion warning

Szymon Zimnowoda via cfe-users cfe-users at lists.llvm.org
Wed Jun 20 06:58:25 PDT 2018

 Hello, consider following code:
https://godbolt.org/g/UN8xTy <https://godbolt.org/g/n3Rt9D>

I do not understand, why overflow warning is here, there is no explicite
int in this code.
When removing constexpr, warning disappears, when changing to:

static constexpr uint8_t b = uint8_t{~a};

warning disappears.

Could someone explain it to me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20180620/af578316/attachment.html>

More information about the cfe-users mailing list