[PATCH] D105997: Implement _ExtInt conversion rules

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 14 09:36:11 PDT 2021


aaron.ballman created this revision.
aaron.ballman added reviewers: rsmith, erichkeane, mibintc, jyknight, rjmccall.
aaron.ballman requested review of this revision.
Herald added a project: clang.

Clang implemented the _ExtInt datatype as a bit-precise integer type, which was then proposed to WG14. WG14 has accepted the proposal (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2709.pdf), but Clang requires some additional work as a result.

In the original Clang implementation, we elected to disallow implicit conversions involving these types until after WG14 finalized the rules. This patch implements the rules decided by WG14: no integer promotion for bit-precise types, conversions prefer the larger of the two types and in the event of a tie (say `_ExtInt(32)` and a 32-bit `int`), the standard type wins.

There are more changes still needed to conform to N2709, but those will be handled in follow-up patches.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105997

Files:
  clang/lib/Sema/SemaExpr.cpp
  clang/test/Sema/ext-int.c
  clang/test/SemaCXX/ext-int.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105997.358642.patch
Type: text/x-patch
Size: 7038 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210714/c71e2781/attachment-0001.bin>


More information about the cfe-commits mailing list