[clang-tools-extra] [clang-tidy] ignore uninitialized std::array in member init (PR #98134)
Piotr Zegar via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 9 02:21:17 PDT 2024
================
@@ -422,6 +422,28 @@ static const char *getInitializer(QualType QT, bool UseAssignment) {
}
}
+static bool isStdArray(QualType QT) {
+ const auto *RT = QT->getAs<RecordType>();
+ if (!RT)
+ return false;
+ const auto *RD = RT->getDecl();
+ if (!RD)
+ return false;
+
+ const IdentifierInfo *II = RD->getIdentifier();
+ if (!II)
+ return false;
+
+ if (II->getName() == "array") {
+ const NamespaceDecl *NS = dyn_cast<NamespaceDecl>(RD->getDeclContext());
+ if (NS && NS->getName() == "std") {
+ return true;
+ }
----------------
PiotrZSL wrote:
```suggestion
if (RD->isInStdNamespace())
return true;
```
https://github.com/llvm/llvm-project/pull/98134
More information about the cfe-commits
mailing list