]> granicus.if.org Git - clang/commitdiff
Fix a bunch more notes that were emitted even when the diagnostic they
authorChandler Carruth <chandlerc@gmail.com>
Wed, 8 Jun 2011 10:26:03 +0000 (10:26 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 8 Jun 2011 10:26:03 +0000 (10:26 +0000)
were intended for was suppressed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132746 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprCXX.cpp

index af30061e28a197686811d3c4ce459d7851be8281..2cd495bf1464d007fa61e45040359a9e6daaf84d 100644 (file)
@@ -1396,27 +1396,30 @@ bool Sema::FindAllocationOverload(SourceLocation StartLoc, SourceRange Range,
   }
 
   case OR_No_Viable_Function:
-    if (Diagnose)
+    if (Diagnose) {
       Diag(StartLoc, diag::err_ovl_no_viable_function_in_call)
         << Name << Range;
-    Candidates.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
+      Candidates.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
+    }
     return true;
 
   case OR_Ambiguous:
-    if (Diagnose)
+    if (Diagnose) {
       Diag(StartLoc, diag::err_ovl_ambiguous_call)
         << Name << Range;
-    Candidates.NoteCandidates(*this, OCD_ViableCandidates, Args, NumArgs);
+      Candidates.NoteCandidates(*this, OCD_ViableCandidates, Args, NumArgs);
+    }
     return true;
 
   case OR_Deleted: {
-    if (Diagnose)
+    if (Diagnose) {
       Diag(StartLoc, diag::err_ovl_deleted_call)
         << Best->Function->isDeleted()
         << Name 
         << getDeletedOrUnavailableSuffix(Best->Function)
         << Range;
-    Candidates.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
+      Candidates.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
+    }
     return true;
   }
   }