]> granicus.if.org Git - clang/commitdiff
Fix assertion (too few Diag arguments) when diagnosing a deleted operator delete
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 25 Feb 2012 09:42:26 +0000 (09:42 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 25 Feb 2012 09:42:26 +0000 (09:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151442 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprCXX.cpp
test/SemaCXX/deleted-operator.cpp

index 95bd6175017b96bb86f83210bab113ef4842c06b..29d21388266bbb579608d24efbb966cb56efda71 100644 (file)
@@ -1881,7 +1881,8 @@ bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD,
     if (Operator->isDeleted()) {
       if (Diagnose) {
         Diag(StartLoc, diag::err_deleted_function_use);
-        Diag(Operator->getLocation(), diag::note_unavailable_here) << true;
+        Diag(Operator->getLocation(), diag::note_unavailable_here)
+          << /*function*/ 1 << /*deleted*/ 1;
       }
       return true;
     }
index e357401bf9424bd66beae17d339ef20bdf5117a1..0e0282ad12cc4ba6ece3d541038d1d6721e3a89f 100644 (file)
@@ -11,3 +11,8 @@ int PR10757f() {
   if(~a1) {} // expected-error {{overload resolution selected deleted operator}} expected-note 6 {{built-in candidate}}
   if(a1==a1) {} // expected-error {{overload resolution selected deleted operator}} expected-note 81 {{built-in candidate}}
 }
+
+struct DelOpDel {
+  virtual ~DelOpDel() {} // expected-error {{deleted function}}
+  void operator delete(void*) = delete; // expected-note {{deleted here}}
+};