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

via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 3 11:10:47 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;
----------------
Serosh-commits 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.

yeah makes sense adding it 

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


More information about the cfe-commits mailing list