[llvm-bugs] [Bug 24938] constexpr variables do not accept bitshift with results of constexpr functions

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 25 09:37:17 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24938

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |FIXED

--- Comment #2 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Clang's diagnostic explains the problem:

  note: shift count 32 >= width of type 'int' (32 bits)

Your initializer has undefined behavior and thus is not a constant expression.
GCC has a bug where it fails to detect some kinds of undefined behavior during
constant expression evaluation.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150925/134d91d0/attachment.html>


More information about the llvm-bugs mailing list