[clang] [clang][Sema] support block pointers as non-type template parameters (PR #191694)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 18 21:17:23 PDT 2026


================
@@ -6844,7 +6849,7 @@ void CXXNameMangler::mangleValueInTemplateArg(QualType T, const APValue &V,
           Out << "cv";
           mangleType(T);
         }
-        if (T->isPointerType())
+        if (T->isPointerType() || T->isBlockPointerType())
----------------
ojhunt wrote:

I'd rather avoid the constant isPointer || isBlockPointer -- there's `hasPointerRepresentation` but it seems plausible that that is too generic and will match incorrect types. A helper `isNTTPCompatiblePointerType()`seems like it might be acceptable - @mizvekov do you have thoughts here? (it could even take an ASTContext so that the answer would be target gated if we really wanted?)

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


More information about the cfe-commits mailing list