Unverified Commit caa90261 authored by offsetof's avatar offsetof Committed by GitHub
Browse files

[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: default avatarVlad Serebrennikov <serebrennikov.vladislav@gmail.com>
parent e57b8724
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment