================
@@ -725,3 +725,19 @@ int (*const_fold)[12] = new int[3][&const_fold + 12 - 
&const_fold];
 // expected-error@-5 {{cannot allocate object of variably modified type}}
 // expected-warning@-6 {{variable length arrays in C++ are a Clang extension}}
 #endif
+
+#if __cplusplus >= 201103L
+namespace PR81157 {
+  struct C {
+    C(int);
+  };
+  int f(int n) {
+    C *ptr1{new C[]{1L}};
+    C *ptr2{new C[n]{1L}};
+    // expected-error@-1 {{no matching constructor}}
+    // expected-note@-6 {{candidate constructor}}
----------------
ojhunt wrote:

nit: use a label for the C constructor

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

Reply via email to