[all-commits] [llvm/llvm-project] 01b9e6: [Clang][Codegen] Truncate initializers of union bi...

tmatheson-arm via All-commits all-commits at lists.llvm.org
Thu Jan 28 01:26:10 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 01b9e613c28b833327ab4de93d0638a5c8d3514f
      https://github.com/llvm/llvm-project/commit/01b9e613c28b833327ab4de93d0638a5c8d3514f
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/CodeGenCXX/bitfield-layout.cpp

  Log Message:
  -----------
  [Clang][Codegen] Truncate initializers of union bitfield members

If an initial value is given for a bitfield that does not fit in the
bitfield, the value should be truncated. Constant folding for
expressions did not account for this truncation in the case of union
member functions, despite a warning being emitted. In some contexts,
evaluation of expressions was not enabled unless C++11, ROPI or RWPI
was enabled.

Differential Revision: https://reviews.llvm.org/D93101




More information about the All-commits mailing list