This is an archive of the discontinued LLVM Phabricator instance.

[Fixed Point Arithmetic] Fix for bug where integer literals could be treated as fixed point literals
ClosedPublic

Authored by leonardchan on Jul 13 2018, 3:49 PM.

Details

Summary

This addresses a bug brought up in https://bugs.llvm.org/show_bug.cgi?id=38161 where integer literals could be treated as fixed point types and throw errors related to fixed point types when the 'k' or 'r' suffix used. The fix also addresses the second issue brought up with the assertion by not treating integers as fixed point types in the first place.

Integers that have suffixes 'k' and 'r' now throw the error invalid suffix 'k/r' on integer constant.

A few more tests were also added to ensure that fixed point types, and any errors/warnings related to them, are limited to C for now.

Prior discussion also at https://reviews.llvm.org/D46915.

Diff Detail

Repository
rC Clang

Event Timeline

leonardchan created this revision.Jul 13 2018, 3:49 PM
leonardchan edited the summary of this revision. (Show Details)Jul 13 2018, 3:51 PM
erichkeane accepted this revision.Jul 16 2018, 6:07 AM
This revision is now accepted and ready to land.Jul 16 2018, 6:07 AM
This revision was automatically updated to reflect the committed changes.