[clang] [clang][Sema] Propagate qualifiers during derived-to-base conversion (PR #127824)
Antonio Frighetto via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 10 08:49:56 PDT 2025
================
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -ast-dump %s | FileCheck %s
+
+// Ensure volatile is preserved during derived-to-base conversion.
----------------
antoniofrighetto wrote:
Added, thanks! `__ptrauth` is in the process of being upstreamed, whereas `_Atomic` seems to have its own semantics (not part of Qualifiers, but rather QualifiersAndAtomic), and I'm not completely sure it would fit here (also accessing members of an atomic struct is UB). Concerning `__restrict`, shouldn't it be property of the pointer, not the object's type? I tried something like:
```cpp
void test_restrict(Derived *__restrict D) {
Base *B = D;
}
```
Yet, in DerivedToBase, `__restrict` seems to be not included in Derived qualifiers (so contextually DestType has not it either, and in any case it should be orthogonal?). Rebased to main too.
https://github.com/llvm/llvm-project/pull/127824
More information about the cfe-commits
mailing list