[clang] [Clang][OpenMP] Bug fix Default clause variable category (PR #165276)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 09:58:11 PDT 2025


================
@@ -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


More information about the cfe-commits mailing list