================ @@ -1245,12 +1245,7 @@ namespace cwg599 { // cwg599: partial // expected-error@-1 {{cannot delete expression with pointer-to-'void' type 'void *'}} delete t; // expected-error@-1 {{cannot delete expression of type 'T'}} - // FIXME: This is valid, but is rejected due to a non-conforming GNU - // extension allowing deletion of pointers to void. delete u; - // expected-error@-1 {{ambiguous conversion of delete expression of type 'U' to a pointer}} ---------------- MitalAshok wrote:
@Endilll There is a set of appropriate types (for `delete`, it's all pointer-to-object types), and there must be exactly one `T` in that set where there is a conversion operator to cv-`T` or reference to cv-`T`. So for `delete u;`, the search finds `T = int*`, so `u` is contextually implicitly converted to `int*`. See also: <https://eel.is/c++draft/conv.general#5> <https://wg21.link/N3323> https://github.com/llvm/llvm-project/pull/92814 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits