[llvm-bugs] [Bug 38161] New: Fixed-Point works poorly with octal/integer literals.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 13 12:00:31 PDT 2018


            Bug ID: 38161
           Summary: Fixed-Point works poorly with octal/integer literals.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: erich.keane at intel.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Perhaps this needs to be 2 different bugs, but I've discovered 2 different
issues having to do with integers and fixed-point literals.

First, integer overflow is never reported!  I can do: 999999999999999999r, and
not get "error: this value is too large for this fixed point type".  The value
emitted is always just int16-max.

Secondly, and most importantly, this asserts when using octal literals.  Simply
auto a = 0r;
causes an assert in LiteralSupport in at least 2 places (LiteralSupport.cpp:737
and 1049).  Either we need to error on trying to do fixed point octal literals,
or just support them.

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/20180713/6edf9ede/attachment.html>

More information about the llvm-bugs mailing list