[LLVMbugs] [Bug 16983] decltype(-9223372036854775808) is unsigned instead of signed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 23 15:00:38 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16983

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

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

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
This code is ill-formed, because 9223372036854775808 does not fit into the
largest signed integer type. We accept it as a GNU extension, and that
extension gives it an unsigned type. (Note that we do not treat __int128 as an
extended integer type, since that would be an ABI-breaking change, so we cannot
give the integer literal that type.)

Unary - preserves the promoted type of its operand, so the resulting decltype
type is also unsigned.

The only bug I can find here is that -pedantic-errors doesn't reject this code.

-- 
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/20130823/4f68b70b/attachment.html>


More information about the llvm-bugs mailing list