[all-commits] [llvm/llvm-project] 192be3: fix: constexpr bit_cast with empty base classes (#...

sethp via All-commits all-commits at lists.llvm.org
Sun Mar 17 09:35:35 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 192be3c9c13363847d176f2c4bba2bd4be5e822f
      https://github.com/llvm/llvm-project/commit/192be3c9c13363847d176f2c4bba2bd4be5e822f
  Author: sethp <seth at codecopse.net>
  Date:   2024-03-17 (Sun, 17 Mar 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp

  Log Message:
  -----------
  fix: constexpr bit_cast with empty base classes (#82383)

Prior to this commit, clang would fail to produce a constant value for
`b` in:

```c++
struct base {
};

struct s : base {
    int z;
};

constexpr auto b = std::bit_cast<s>(0x12); 
```

e.g. https://godbolt.org/z/srrbTMPq4



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list