Files
clang-p2996/clang/test/CXX/expr/expr.const/p5-26.cpp
offsetof caa902613a [clang] Allow constexpr cast from void* in more cases (#89484)
[[expr.const]/5.14](https://eel.is/c++draft/expr.const#5.14) says that
constexpr cast from <code>*cv* void\*</code> to `T*` is OK if the
pointee type is similar to `T`, but Clang currently only permits the
conversion if the types are the same except top-level cv-qualifiers.

This patch also allows casting `(void*)nullptr`, implementing the
resolution of [CWG2819](https://cplusplus.github.io/CWG/issues/2819).

---------

Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
2024-04-29 17:23:50 +04:00

2.2 KiB