[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 27 12:13:55 PDT 2024
================
@@ -2837,6 +2837,10 @@ bool QualType::hasNonTrivialToPrimitiveCopyCUnion(const RecordDecl *RD) {
return RD->hasNonTrivialToPrimitiveCopyCUnion();
}
+bool QualType::hasUninitializedExplicitInitFields(const RecordDecl *RD) {
----------------
higher-performance wrote:
The implementation is more complicated:
```
inline bool QualType::hasUninitializedExplicitInitFields() const {
if (auto *RD = getTypePtr()->getBaseElementTypeUnsafe()->getAsRecordDecl())
return hasUninitializedExplicitInitFields(RD);
return false;
}
```
The other attributes right above this (like `hasNonTrivialToPrimitiveCopyCUnion`) are handled the same way, so I didn't imagine I should deviate from the pattern.
https://github.com/llvm/llvm-project/pull/102040
More information about the cfe-commits
mailing list