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

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 09:43:58 PDT 2026


================
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -std=c++20 -fblocks -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
+
+template<void (^B)()> void f() {}
+
+// CHECK: define{{.*}} void @_Z12test_literalv()
+void test_literal() {
+  // CHECK: call void @_Z1fIXcvU13block_pointerFvvEadUb_EEvv()
+  f<^{}>();
+}
+
+constexpr void (^global_block)() = ^{};
+// CHECK: define{{.*}} void @_Z11test_globalv()
+void test_global() {
----------------
mizvekov wrote:

Ditto

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


More information about the cfe-commits mailing list