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

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 11 05:33:29 PST 2025


================
@@ -1314,6 +1314,31 @@ static std::string getOpenMPClauseNameForDiag(OpenMPClauseKind C) {
   return getOpenMPClauseName(C).str();
 }
 
+static bool isAllocatableType(QualType QT) {
+  if (QT->isPointerType())
+    return true;
+
+  QT = QT.getCanonicalType().getUnqualifiedType();
+  if (const auto *RD = QT->getAsCXXRecordDecl())
+    if (const auto *Spec = dyn_cast<ClassTemplateSpecializationDecl>(RD))
+      if (const auto *CTD = Spec->getSpecializedTemplate())
+        if (const auto *NS =
+                dyn_cast_or_null<NamespaceDecl>(CTD->getDeclContext())) {
+          StringRef Name = CTD->getIdentifier()->getName();
+
+          if (NS->isStdNamespace())
+            if (Name == "vector" || Name == "unique_ptr" ||
+                Name == "shared_ptr" || Name == "array")
+              return true;
+
+          if (NS->getIdentifier()->getName() == "llvm")
+            if (Name == "SmallVector")
+              return true;
----------------
alexey-bataev wrote:

There should not be anything like this. Please, remove!

https://github.com/llvm/llvm-project/pull/165276


More information about the cfe-commits mailing list