[clang] [ClANG]Fix block pointer NTTP crash (PR #190377)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 3 11:07:20 PDT 2026


================
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fblocks -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+template<void (^)(void)> struct T;
+T<nullptr> *t;
----------------
mizvekov wrote:

Can you add at least one non-null test case?

Something like:
```C++
template<int (^F)(void)> struct T { static int value = F(); };
static_assert(T<^(){ return 42; }>::value == 42);
```

I think we need minimal proof that this works beyond null values, because otherwise if it's not implemented correctly, we might as well just reject.

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


More information about the cfe-commits mailing list