[all-commits] [llvm/llvm-project] 6bb042: Implement _ExtInt conversion rules

Aaron Ballman via All-commits all-commits at lists.llvm.org
Thu Jul 22 06:11:46 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bb042e70024354acc65457e153b40d50cada4f5
      https://github.com/llvm/llvm-project/commit/6bb042e70024354acc65457e153b40d50cada4f5
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/Sema/ext-int.c
    M clang/test/SemaCXX/ext-int.cpp

  Log Message:
  -----------
  Implement _ExtInt conversion rules

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.




More information about the All-commits mailing list