================
@@ -1314,6 +1314,22 @@ static std::string
getOpenMPClauseNameForDiag(OpenMPClauseKind C) {
return getOpenMPClauseName(C).str();
}
+bool isAllocatableType(QualType QT) {
+ if (QT->isPointerType())
+ return true;
+ QT = QT.getCanonicalType().getUnqualifiedType();
+ if (const CXXRecordDecl *RD = QT->getAsCXXRecordDecl()) {
+ if (isa<ClassTemplateSpecializationDecl>(RD)) {
+ std::string QName = RD->getQualifiedNameAsString();
+ return (QName == "std::vector" || QName == "vector" ||
+ QName == "std::unique_ptr" || QName == "unique_ptr" ||
+ QName == "std::shared_ptr" || QName == "shared_ptr" ||
+ QName == "llvm::SmallVector" || QName == "SmallVector");
+ }
+ }
+ return false;
+}
----------------
alexey-bataev wrote:
Poor check, it should not check the names, should check the members
https://github.com/llvm/llvm-project/pull/165276
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits