aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2024-04-13 08:55:09 +0400
committerGitHub <noreply@github.com>2024-04-13 08:55:09 +0400
commit6dcb60481323c871556a5a14ed887a5867ece114 (patch)
tree2a7133356cb86710c9aa15de665a4b6a879915ee /clang/lib/Basic/Module.cpp
parent0a6f6df5b0c3d0f2a42f013bf5cafb9b5020dcac (diff)
downloadllvm-6dcb60481323c871556a5a14ed887a5867ece114.zip
llvm-6dcb60481323c871556a5a14ed887a5867ece114.tar.gz
llvm-6dcb60481323c871556a5a14ed887a5867ece114.tar.bz2
[clang] Implement `__is_pointer_interconvertible_base_of()` (#88473)
This patch implements intrinsic that supports `std::is_pointer_interconvertible_base_of` type trait from [P0466R5](https://wg21.link/p0466r5) "Layout-compatibility and Pointer-interconvertibility Traits". Normative wording: > Comment: If `Base` and Derived are non-union class types and are not (possibly _cv_-qualified) versions of the same type, `Derived` is a complete type. > Condition: `Derived` is unambiguously derived from `Base` without regard to _cv_-qualifiers, and each object of type `Derived` is pointer-interconvertible (6.7.2 [basic.compound]) with its `Base` subobject, or `Base` and `Derived` are not unions and name the same class type without regard to _cv_-qualifiers. The paper also express the following intent: > Note that `is_pointer_interconvertible_base_of_v<T,T>` is always true under this wording, even though `T` is not derived from itself. I find the treatment of unions in the wording contradictory to this intent, and I'm not able to find anything relevant in minutes or on the reflector. That said, this patch implements what the wording says, since it's very explicit about unions.
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
0 files changed, 0 insertions, 0 deletions