================
@@ -9,6 +9,17 @@ namespace VoidCast {
   constexpr void* p = nullptr;
   constexpr int* q = static_cast<int*>(p);
   static_assert(q == nullptr);
+
+  static_assert((delete (int*)(void*)new int, true));
+  static_assert((delete[] (int*)(void*)new int[2], true));
+
+  // both-error@+2 {{not an integral constant expression}}
+  // both-note@+1 {{cast from 'void *' is not allowed in a constant expression 
because the pointed object type 'int' is not similar to the target type 
'float'}}
+  static_assert((delete (float*)(void*)new int, true));
----------------
keinflue wrote:

done

https://github.com/llvm/llvm-project/pull/174132
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to