From: Douglas Gregor Date: Fri, 27 Aug 2010 21:39:15 +0000 (+0000) Subject: Improve wording of diagnostic complaining about a non-void* pointer as the first... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=520441eb82202702688750860fd98148421ea0ed;p=clang Improve wording of diagnostic complaining about a non-void* pointer as the first parameter of operator delete git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112298 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 2a1e8a7a29..32550dc616 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2941,7 +2941,7 @@ def err_operator_new_default_arg: Error< def err_operator_delete_dependent_param_type : Error< "%0 cannot take a dependent type as first parameter; use %1 instead">; def err_operator_delete_param_type : Error< - "%0 takes type %1 as first parameter">; + "first parameter of %0 must have type %1">; // C++ literal operators def err_literal_operator_outside_namespace : Error< diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp index b127e667c5..9a64e4c01d 100644 --- a/test/SemaCXX/new-delete.cpp +++ b/test/SemaCXX/new-delete.cpp @@ -344,3 +344,13 @@ namespace TemplateDestructors { template void operator delete(void*, const size_t, const int, T*); }; } + +namespace DeleteParam { + struct X { + void operator delete(X*); // expected-error{{first parameter of 'operator delete' must have type 'void *'}} + }; + + struct Y { + void operator delete(void* const); + }; +}