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

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 13 15:49:51 PDT 2018


leonardchan created this revision.
leonardchan added reviewers: erichkeane, ebevhan, rjmccall, rsmith, jakehehrlich, mcgrathr, phosek.
leonardchan added a project: clang.

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 'cannot use k/r in integer literal'.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D49327

Files:
  clang/lib/Lex/LiteralSupport.cpp
  clang/test/Frontend/fixed_point_errors.c
  clang/test/Frontend/fixed_point_errors.cpp
  clang/test/Frontend/fixed_point_not_enabled.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49327.155519.patch
Type: text/x-patch
Size: 8345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180713/ccf553ab/attachment-0001.bin>


More information about the cfe-commits mailing list